|
|
@@ -229,7 +229,7 @@ class UserController
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 消费余额转购物积分
|
|
|
+ * 转换
|
|
|
* @param Request $request
|
|
|
* @return mixed
|
|
|
*/
|
|
|
@@ -243,8 +243,18 @@ class UserController
|
|
|
$datas=[];
|
|
|
$datas['amount']=$data['amount'];
|
|
|
$datas['uid']=$uid['uid'];
|
|
|
- $datas['type1']='now_money';
|
|
|
- $datas['type2']='sp_final';
|
|
|
+ $datas['type']=$data['type'];
|
|
|
+ // 消费余额转购物积分
|
|
|
+ if($data['type']==1){
|
|
|
+ $datas['type1']='now_money';
|
|
|
+ $datas['type2']='sp_final';
|
|
|
+ }
|
|
|
+ // 购物积分转换成提货券
|
|
|
+ if($data['type']==2){
|
|
|
+ $datas['type1']='sp_final';
|
|
|
+ $datas['type2']='top_ticket';
|
|
|
+ }
|
|
|
+
|
|
|
$res=$this->change($datas);
|
|
|
if($res=0){
|
|
|
return app('json')->fail('转换失败!');
|
|
|
@@ -262,11 +272,14 @@ class UserController
|
|
|
$res=User::where('uid',$data['uid'])->find();
|
|
|
$type1=intval($res[$data['type1']]-$data['amount']);
|
|
|
$type2=intval($res[$data['type2']]+$data['amount']);
|
|
|
+ $type3=intval($res[$data['aid_val']]+$data['amount']);
|
|
|
+ if($data['type']==2){
|
|
|
+ $res1=User::where('uid',$data['uid'])->update([$data['type1'] =>$type1,$data['type2']=>$type2,'aid_val'=>$type3]);
|
|
|
+ }
|
|
|
$res1=User::where('uid',$data['uid'])->update([$data['type1'] =>$type1,$data['type2']=>$type2]);
|
|
|
return $res1;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
* 修改 添加地址
|
|
|
* @param Request $request
|