调整订单列表统计
This commit is contained in:
parent
98bf64a0ba
commit
979d3dc25a
@ -50,6 +50,9 @@ class StoreRefundOrderDao extends BaseDao
|
||||
})->when(isset($where['order_sn']) && $where['order_sn'] !== '', function ($query) use ($where) {
|
||||
$ids = StoreOrder::where('order_sn','like','%'.$where['order_sn'].'%')->column('order_id');
|
||||
$query->where('order_id','in',$ids);
|
||||
})->when(isset($where['product_type']) && $where['product_type'] !== '', function ($query) use ($where) {
|
||||
$ids = StoreOrder::where('uid', $where['uid'])->where('activity_type', $where['product_type'])->column('order_id');
|
||||
$query->where('order_id','in',$ids);
|
||||
})->when(isset($where['refund_order_sn']) && $where['refund_order_sn'] !== '', function ($query) use ($where) {
|
||||
$query->where('refund_order_sn', 'like', '%' . $where['refund_order_sn'] . '%');
|
||||
})->when(isset($where['status']) && $where['status'] !== '', function ($query) use ($where) {
|
||||
|
@ -15,6 +15,7 @@ use app\common\dao\store\order\StoreOrderDao;
|
||||
use app\common\model\store\order\StoreGroupOrder;
|
||||
use app\common\model\store\order\StoreOrder;
|
||||
use app\common\model\store\order\StoreOrderInterest;
|
||||
use app\common\model\store\order\StoreRefundOrder;
|
||||
use app\common\model\store\product\PurchaseRecord;
|
||||
use app\common\model\user\User;
|
||||
use app\common\repositories\BaseRepository;
|
||||
@ -567,7 +568,7 @@ class StoreOrderRepository extends BaseRepository
|
||||
$noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||
$noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'paid' => 1,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||
$done = $this->dao->search(['uid' => $uid, 'status' => 3, 'paid' => 1,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||
$refund = app()->make(StoreRefundOrderRepository::class)->getWhereCount(['uid' => $uid, 'status' => [0, 1, 2]]);
|
||||
$refund = StoreRefundOrder::alias('t1')->join('store_order t2', 't1.order_id=t2.order_id')->where('t1.uid', $uid)->whereIn('t1.status', [0, 1, 2])->where('t2.activity_type', $product_type)->fetchSql()->select();
|
||||
//$orderPrice = $this->dao->search(['uid' => $uid, 'paid' => 1])->sum('pay_price');
|
||||
$all = $this->dao->search(['uid' => $uid, 'status' => -2,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||
$orderCount = $this->dao->search(['uid' => $uid, 'paid' => 1,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||
|
@ -151,11 +151,13 @@ class StoreRefundOrder extends BaseController
|
||||
public function lst()
|
||||
{
|
||||
$type = $this->request->param('type');
|
||||
$productType = $this->request->param('product_type', 0);
|
||||
[$page, $limit] = $this->getPage();
|
||||
return app('json')->success($this->repository->userList([
|
||||
'type' => $type,
|
||||
'uid' => $this->request->uid(),
|
||||
'is_del' => 0,
|
||||
'product_type' => $productType,
|
||||
], $page, $limit));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user