更新
This commit is contained in:
parent
b1b89e5a26
commit
49c48f02b0
@ -628,7 +628,7 @@ class StoreOrderRepository extends BaseRepository
|
||||
* @author xaboy
|
||||
* @day 2020/6/10
|
||||
*/
|
||||
public function userOrderNumber(int $uid, $product_type = 0)
|
||||
public function userOrderNumber(int $uid, $product_type = 0,$source=2)
|
||||
{
|
||||
//activity_type:0普通订单 98采购订单 99委托商品
|
||||
//$noPay = app()->make(StoreGroupOrderRepository::class)->orderNumber($uid, $product_type);
|
||||
@ -636,14 +636,20 @@ class StoreOrderRepository extends BaseRepository
|
||||
if ($product_type == 98 || $product_type == 99) {
|
||||
$isUser = 0;
|
||||
}
|
||||
$noPay = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(1))->whereRaw("(StoreOrder.paid=0 and StoreOrder.pay_type!=8) or (StoreOrder.paid=1 and StoreOrder.pay_type=8 and StoreOrder.status=2)")->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||
$noPostage = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(2))->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$noDeliver = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(3))->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$noComment = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(4))->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$done = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(5))->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$where['activity_type']=$product_type;
|
||||
if($source==103){
|
||||
$where['activity_type']=[0,98];
|
||||
$where['source']=[2,103];
|
||||
}
|
||||
$noComment = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(4))->where($where)->where('StoreOrder.is_del', 0)->count();
|
||||
$noPay = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(1))->whereRaw("(StoreOrder.paid=0 and StoreOrder.pay_type!=8) or (StoreOrder.paid=1 and StoreOrder.pay_type=8 and StoreOrder.status=2)")->where($where)->where('StoreOrder.is_del', 0)->count();
|
||||
$noPostage = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(2))->where($where)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$noDeliver = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(3))->where($where)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$noComment = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(4))->where($where)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$done = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(5))->where($where)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$refund = StoreRefundOrder::alias('t1')->join('store_order t2', 't1.order_id=t2.order_id')->where('t1.uid', $uid)->where('t1.status', 3)->where('t2.activity_type', $product_type)->count();
|
||||
$orderPrice = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(8))->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->sum('pay_price');
|
||||
$orderCount = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$orderPrice = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(8))->where($where)->where('StoreOrder.is_del', 0)->fetchSql(false)->sum('pay_price');
|
||||
$orderCount = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($where)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
return compact('noComment', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderPrice', 'orderCount');
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,8 @@ class StoreOrder extends BaseController
|
||||
public function number()
|
||||
{
|
||||
$productType = $this->request->param('product_type', 0);
|
||||
return app('json')->success($this->repository->userOrderNumber($this->request->uid(), $productType));
|
||||
$source = $this->request->param('source', 2);
|
||||
return app('json')->success($this->repository->userOrderNumber($this->request->uid(), $productType,$source));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user