修改采购订单列表查询
This commit is contained in:
parent
7b73e904af
commit
cc2ae7d4a2
@ -107,7 +107,7 @@ class StoreOrderDao extends BaseDao
|
|||||||
$query->where('paid', 1)->whereIn('StoreOrder.status', [10, 11]);
|
$query->where('paid', 1)->whereIn('StoreOrder.status', [10, 11]);
|
||||||
break;
|
break;
|
||||||
case 2 :
|
case 2 :
|
||||||
$query->where('StoreOrder.status', $where['status'])->where('pay_type', '!=', StoreGroupOrder::PAY_TYPE_CREDIT_BUY);
|
$query->where('StoreOrder.status', $where['status'])->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY);
|
||||||
break;
|
break;
|
||||||
case 20 :
|
case 20 :
|
||||||
$query->whereRaw('paid=0 or (StoreOrder.status=' . StoreOrder::STATUS_WAIT_COMMENT . ' and pay_type=' . StoreGroupOrder::PAY_TYPE_CREDIT_BUY . ')');
|
$query->whereRaw('paid=0 or (StoreOrder.status=' . StoreOrder::STATUS_WAIT_COMMENT . ' and pay_type=' . StoreGroupOrder::PAY_TYPE_CREDIT_BUY . ')');
|
||||||
|
@ -562,15 +562,15 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
*/
|
*/
|
||||||
public function userOrderNumber(int $uid, $product_type=0)
|
public function userOrderNumber(int $uid, $product_type=0)
|
||||||
{
|
{
|
||||||
$noPay = app()->make(StoreGroupOrderRepository::class)->orderNumber($uid,$product_type);
|
$noPay = $this->dao->search(['uid' => $uid, 'status' => 20,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
|
||||||
$noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 1,'is_user' => 1])->where('StoreOrder.is_del', 0)->count();
|
$noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 1,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
|
||||||
$all = $this->dao->search(['uid' => $uid, 'status' => -2,'is_user' => 1])->where('StoreOrder.is_del', 0)->count();
|
$all = $this->dao->search(['uid' => $uid, 'status' => -2,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
|
||||||
$noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1])->where('StoreOrder.is_del', 0)->count();
|
$noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
|
||||||
$noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'paid' => 1,'is_user' => 1])->where('StoreOrder.is_del', 0)->count();
|
$noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'paid' => 1,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
|
||||||
$done = $this->dao->search(['uid' => $uid, 'status' => 3, 'paid' => 1,'is_user' => 1])->where('StoreOrder.is_del', 0)->count();
|
$done = $this->dao->search(['uid' => $uid, 'status' => 3, 'paid' => 1,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count();
|
||||||
$refund = app()->make(StoreRefundOrderRepository::class)->getWhereCount(['uid' => $uid, 'status' => [0, 1, 2]]);
|
$refund = app()->make(StoreRefundOrderRepository::class)->getWhereCount(['uid' => $uid, 'status' => [0, 1, 2]]);
|
||||||
//$orderPrice = $this->dao->search(['uid' => $uid, 'paid' => 1])->sum('pay_price');
|
//$orderPrice = $this->dao->search(['uid' => $uid, 'paid' => 1])->sum('pay_price');
|
||||||
$orderCount = $this->dao->search(['uid' => $uid, 'paid' => 1,'is_user' => 1])->count();
|
$orderCount = $this->dao->search(['uid' => $uid, 'paid' => 1,'is_user' => 1, 'product_type' => $product_type])->count();
|
||||||
return compact('noComment', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderCount', 'all');
|
return compact('noComment', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderCount', 'all');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user