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

接口

... ... @@ -85,7 +85,7 @@ class GoodsController extends RestBaseController
]);
if ($re) {
Db::name('user')->where('id',$this->getUserId())->setDec('score',$param['price']);
Db::name('user_score_log')->insert(['user_id'=>$this->getUserId(),'score'=>-$param['price'],'action'=>'消费','now_score'=>$user_score-$param['price']]);
Db::name('user_score_log')->insert(['user_id'=>$this->getUserId(),'score'=>-$param['price'],'action'=>'消费','now_score'=>$user_score-$param['price'],'create_time'=>time()]);
Db::name('goods')->where('id',$param['goods_id'])->setDec('stock',$param['count']);
$this->success('兑换成功');
}else{
... ...