作者 潘浩文
1 个管道 的构建 通过 耗费 1 秒

个人中心接口

... ... @@ -61,7 +61,7 @@ class GoodsController extends RestBaseController
* @param name:address_id type:int require:1 other: desc:收货地址id
* @param name:remark type:text require:0 other: desc:备注
* @param name:count type:int require:1 other: desc:商品数量
* @param name:price type:int require:1 other: desc:商品数量
* @param name:price type:int require:1 other: desc:实付金额
*/
public function orderPost()
{
... ... @@ -82,7 +82,7 @@ class GoodsController extends RestBaseController
]);
if ($re) {
Db::name('user')->where('id',$this->getUserId())->setDec('score',$param['score']);
Db::name('user_score_log')->insert(['user_id'=>$this->getUserId(),'score'=>$param['score'],'action'=>'消费','now_score'=>$user_score-$param]);
Db::name('user_score_log')->insert(['user_id'=>$this->getUserId(),'score'=>-$param['score'],'action'=>'消费','now_score'=>$user_score-$param]);
$this->success('兑换成功',1);
}else{
$this->error('兑换失败',3);
... ...
... ... @@ -11,8 +11,6 @@ use think\Db;
/**
* @title 我的
* @description 个人中心相关接口
* @header name:key require:1 default: desc:秘钥(区别设置)
* @param name:public type:int require:1 default:1 other: desc:公共参数(区别设置)
*/
class UserController extends RestBaseController
{
... ... @@ -22,7 +20,7 @@ class UserController extends RestBaseController
* @author panhaowen
* @url /portal/User/info
* @method POST
* @param
* @header name:XX-Token require:1 default: desc:token
*/
public function info()
{
... ... @@ -30,8 +28,17 @@ class UserController extends RestBaseController
$data['now_weight']=Db::name('user_week_sign')->where('user_id',$this->getUserId())->order('create_time','desc')->limit(1)['weight'];
$this->success('我的健康档案',$data);
}
/**
* @title 我的积分管理
* @description 积分记录接口
* @author panhaowen
* @url /portal/User/info
* @method POST
* @header name:XX-Token require:1 default: desc:token
*/
public function scoreLog(){
$data=1;
$data=Db::name('user_score_log')->where('user_id',$this->getUserId())->select();
Db::name('user_score_log')->insert(['score'=>-1]);
$this->success('我的健康档案',$data);
}
}
... ...