...
|
...
|
@@ -41,6 +41,23 @@ class Cart extends Api |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 购物车-获取购物车商品总数
|
|
|
* @ApiMethod (GET)
|
|
|
* @ApiRoute (/api/cart/getCartNum)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
|
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'msg':'返回成功'
|
|
|
})
|
|
|
*/
|
|
|
public function getCartNum(){
|
|
|
$this->success(__('成功'),$this->model->where(['user_id'=>$this->user['id'],'isbuynow'=>'0'])->sum('goods_num'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 购物车-加入购物车
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
...
|
...
|
|