Merge branch 'develop'
This commit is contained in:
commit
1dcdbcf0fb
@ -549,18 +549,29 @@ class StoreOrderRepository extends BaseRepository
|
||||
* @author xaboy
|
||||
* @day 2020/6/10
|
||||
*/
|
||||
public function userOrderNumber(int $uid)
|
||||
public function userOrderNumber(int $uid, $source = 2)
|
||||
{
|
||||
$noPay = app()->make(StoreGroupOrderRepository::class)->orderNumber($uid);
|
||||
$noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 1])->where('StoreOrder.is_del', 0)->count();
|
||||
$all = $this->dao->search(['uid' => $uid, 'status' => -2])->where('StoreOrder.is_del', 0)->count();
|
||||
|
||||
$noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 1])
|
||||
->where('StoreOrder.is_del', 0)
|
||||
->where('source', $source)
|
||||
->count();
|
||||
|
||||
$all = $this->dao->search(['uid' => $uid, 'status' => -2])
|
||||
->where('source', $source)
|
||||
->where('StoreOrder.is_del', 0)
|
||||
->count();
|
||||
|
||||
$noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1])->where('StoreOrder.is_del', 0)->count();
|
||||
$noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'paid' => 1])->where('StoreOrder.is_del', 0)->count();
|
||||
$done = $this->dao->search(['uid' => $uid, 'status' => 3, 'paid' => 1])->where('StoreOrder.is_del', 0)->count();
|
||||
$refund = app()->make(StoreRefundOrderRepository::class)->getWhereCount(['uid' => $uid, 'status' => [0, 1, 2]]);
|
||||
//$orderPrice = $this->dao->search(['uid' => $uid, 'paid' => 1])->sum('pay_price');
|
||||
$orderCount = $this->dao->search(['uid' => $uid, 'paid' => 1])->count();
|
||||
return compact('noComment', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderCount', 'all');
|
||||
$orderPrice = $this->dao->search(['uid' => $uid, 'paid' => 1])->where('source', $source)->sum('pay_price');
|
||||
$orderCount = $this->dao->search(['uid' => $uid, 'paid' => 1])
|
||||
->where('source', $source)
|
||||
->count();
|
||||
return compact('noComment', 'orderPrice', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderCount', 'all');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -185,7 +185,10 @@ class StoreOrder extends BaseController
|
||||
*/
|
||||
public function number()
|
||||
{
|
||||
return app('json')->success(['orderPrice' => $this->request->userInfo()->pay_price] + $this->repository->userOrderNumber($this->request->uid()));
|
||||
$source = $this->request->param('source');
|
||||
$source = !isset($source)?2:$source; // 默认来源为2 普通商品订单
|
||||
// return app('json')->success(['orderPrice' => $this->request->userInfo()->pay_price] + $this->repository->userOrderNumber($this->request->uid(), $source));
|
||||
return app('json')->success($this->repository->userOrderNumber($this->request->uid(), $source));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user