作者 耿培杰

添加购物车数量接口

... ... @@ -20,6 +20,26 @@ class Car extends Api
$this->carModel = new \app\api\model\Car;
}
/**
* @ApiTitle (获取购物车数量)
* @ApiSummary (获取购物车数量)
* @ApiMethod (POST)
* @ApiRoute (/api/car/getCarNumber)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiReturn({
"code": 1,
"msg": "SUCCESS",
"time": "1587610459",
"data": 1 购物车数量
})
*/
public function getCarNumber(){
$userId = $this->getUserId();
$where['user_id'] = $userId;
$data = $this->carModel->where($where)->count();
$this->success('SUCCESS',$data);
}
/**
* @ApiTitle (获取购物车列表)
... ...
此 diff 太大无法显示。