更新订单统计信息接口
This commit is contained in:
parent
d021e4e6a1
commit
0a1878b6f1
@ -25,7 +25,7 @@ class StoreGroupOrder extends BaseModel
|
|||||||
const PAY_TYPE_WECHAT = 1; //微信支付
|
const PAY_TYPE_WECHAT = 1; //微信支付
|
||||||
const PAY_TYPE_ROUTINE = 2; //小程序支付
|
const PAY_TYPE_ROUTINE = 2; //小程序支付
|
||||||
const PAY_TYPE_H5 = 3; //H5支付
|
const PAY_TYPE_H5 = 3; //H5支付
|
||||||
const PAY_TYPE_CREDIT_BUY = 8; //信用购
|
const PAY_TYPE_CREDIT_BUY = 8; //信用购 先货后款
|
||||||
|
|
||||||
public static function tablePk(): ?string
|
public static function tablePk(): ?string
|
||||||
{
|
{
|
||||||
|
@ -563,16 +563,23 @@ 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);
|
//activity_type:0 采购订单 98 普通订单
|
||||||
$noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 1,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
//$noPay = app()->make(StoreGroupOrderRepository::class)->orderNumber($uid, $product_type);
|
||||||
$noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
//ok
|
||||||
$noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'paid' => 1,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
$noPay = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 0, '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();
|
//ok
|
||||||
$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();
|
$noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 1, 'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||||
//$orderPrice = $this->dao->search(['uid' => $uid, 'paid' => 1])->sum('pay_price');
|
//ok
|
||||||
$all = $this->dao->search(['uid' => $uid, 'status' => -2,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
$noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1, '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();
|
//ok
|
||||||
return compact('noComment', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderCount', 'all');
|
$noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'paid' => 1, 'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||||
|
//ok
|
||||||
|
$done = $this->dao->search(['uid' => $uid, 'status' => 3, 'paid' => 1, 'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||||
|
//ok
|
||||||
|
$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();
|
||||||
|
//$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, 'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||||
|
return compact('noComment', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderCount');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user