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

接口

@@ -87,9 +87,9 @@ class GoodsController extends RestBaseController @@ -87,9 +87,9 @@ class GoodsController extends RestBaseController
87 Db::name('user')->where('id',$this->getUserId())->setDec('score',$param['score']); 87 Db::name('user')->where('id',$this->getUserId())->setDec('score',$param['score']);
88 Db::name('user_score_log')->insert(['user_id'=>$this->getUserId(),'score'=>-$param['score'],'action'=>'消费','now_score'=>$user_score-$param['score']]); 88 Db::name('user_score_log')->insert(['user_id'=>$this->getUserId(),'score'=>-$param['score'],'action'=>'消费','now_score'=>$user_score-$param['score']]);
89 Db::name('goods')->where('id',$param['goods_id'])->setDec('stock',$param['count']); 89 Db::name('goods')->where('id',$param['goods_id'])->setDec('stock',$param['count']);
90 - $this->success('兑换成功',1); 90 + $this->success('兑换成功');
91 }else{ 91 }else{
92 - $this->error('兑换失败',4); 92 + $this->error('兑换失败');
93 } 93 }
94 } 94 }
95 95