...
|
...
|
@@ -23,6 +23,46 @@ class Orders extends Api |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (我的订单状态数量)
|
|
|
* @ApiSummary (我的订单状态数量)
|
|
|
* @ApiMethod (GET)
|
|
|
* @ApiRoute (/api/orders/myOrderTotal)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1575700114",
|
|
|
"data": {
|
|
|
"total": 1,//待付款
|
|
|
"total1": 0,//待发货
|
|
|
"total2": 0,//待收货
|
|
|
"total3": 1,//已完成
|
|
|
"total4": 1//退换货
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function myOrderTotal(){
|
|
|
if($this->request->isGet()){
|
|
|
$arr = [];
|
|
|
$status = $this->order_status;
|
|
|
//待付款
|
|
|
$arr['total'] = Common::countSoftTotal('order',['uid'=>$this->uid,'status'=>$status[0]]);
|
|
|
//待发货
|
|
|
$arr['total1'] = Common::countSoftTotal('order',['uid'=>$this->uid,'status'=>$status[2]]);
|
|
|
//待收货
|
|
|
$arr['total2'] = Common::countSoftTotal('order',['uid'=>$this->uid,'status'=>$status[5]]);
|
|
|
//已完成
|
|
|
$arr['total3'] = Common::countSoftTotal('order',['uid'=>$this->uid,'status'=>$status[8]]);
|
|
|
//退换货
|
|
|
$arr['total4'] = Common::countSoftTotal('order',['uid'=>$this->uid,'status'=>['in',[6,7]]]);
|
|
|
$this->success('成功',$arr);
|
|
|
}else{
|
|
|
$this->error('请求方式错误');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (我的订单)
|
|
|
* @ApiSummary (我的订单)
|
|
|
* @ApiMethod (GET)
|
...
|
...
|
|