作者 何书鹏

订单数量

... ... @@ -106,6 +106,7 @@ class Order extends Api
'fa_litestore_order.pay_status' => '20',
'fa_litestore_order.freight_status' => '20',
'fa_litestore_order.receipt_status' => '20',
'fa_litestore_order.order_status' => '10',
];
break;
}
... ... @@ -827,4 +828,50 @@ class Order extends Api
$this->success('SUCCESS');
}
/**
* @ApiTitle (订单数量)
* @ApiMethod (GET)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiReturn({
"code": 1,
"msg": "订单数量",
"time": "1609138878",
"data": {
"nopay": 2, //待支付(数量)
"nosend": 3, //待发货(数量)
"noget": 0, //待收货(数量)
"nocomment": 0, //待评价(数量)
}
})
*/
public function statusNum () {
$model = new \app\api\model\Order();
$nopay = $model->where([
'status' => 'normal',
'user_id' => $this->auth->id,
'pay_status' => '10',
])->count();
$nosend = $model->where([
'status' => 'normal',
'user_id' => $this->auth->id,
'pay_status' => '20',
'freight_status' => '10',
])->count();
$noget = $model->where([
'status' => 'normal',
'user_id' => $this->auth->id,
'pay_status' => '20',
'freight_status' => '20',
'receipt_status' => '10',
])->count();
$nocomment = $model->where([
'status' => 'normal',
'user_id' => $this->auth->id,
'pay_status' => '20',
'freight_status' => '20',
'receipt_status' => '20',
'order_status' => '10'
])->count();
$this->success('订单数量', compact('nopay','nosend','noget','nocomment'));
}
}
\ No newline at end of file
... ...