作者 董瑞恩
1 个管道 的构建 通过 耗费 1 秒

order

@@ -92,7 +92,7 @@ class UsersController extends HomeBaseController{ @@ -92,7 +92,7 @@ class UsersController extends HomeBaseController{
92 */ 92 */
93 public function payDeposit(){ 93 public function payDeposit(){
94 $users_id=$this->request->param('users_id'); 94 $users_id=$this->request->param('users_id');
95 - $users=Db::name('users')->where('users_id',$users_id)->find(); 95 + $users=Db::name('users')->where('id',$users_id)->find();
96 $openId=$users['open_id']; 96 $openId=$users['open_id'];
97 $order_no = cmf_get_order_sn(); 97 $order_no = cmf_get_order_sn();
98 $body="押金-支付"; 98 $body="押金-支付";
@@ -102,7 +102,7 @@ class UsersController extends HomeBaseController{ @@ -102,7 +102,7 @@ class UsersController extends HomeBaseController{
102 $data=$wxPay->pay(); 102 $data=$wxPay->pay();
103 if (isset($data['package'])){ 103 if (isset($data['package'])){
104 try{ 104 try{
105 - Db::name('users')->where(['users_id'=>$users_id])->update(['deposit_order_no'=>$order_no]); 105 + Db::name('users')->where(['id'=>$users_id])->update(['deposit_order_no'=>$order_no]);
106 }catch (\Exception $exception){ 106 }catch (\Exception $exception){
107 107
108 } 108 }
@@ -155,12 +155,12 @@ class UsersController extends HomeBaseController{ @@ -155,12 +155,12 @@ class UsersController extends HomeBaseController{
155 */ 155 */
156 public function refundDeposit(){ 156 public function refundDeposit(){
157 $users_id=$this->request->param('users_id'); 157 $users_id=$this->request->param('users_id');
158 - $users=Db::name('users')->where('users_id',$users_id)->find(); 158 + $users=Db::name('users')->where('id',$users_id)->find();
159 $orderNo=$users['deposit_order_no'];//需要退款的订单 159 $orderNo=$users['deposit_order_no'];//需要退款的订单
160 $price=$users['deposit']; 160 $price=$users['deposit'];
161 Db::startTrans(); 161 Db::startTrans();
162 try{ 162 try{
163 - Db::name('users')->where('users_id',$users_id)->update(['is_deposit'=>0,'deposit'=>null,'deposit_order_no'=>null]); 163 + Db::name('users')->where('id',$users_id)->update(['is_deposit'=>0,'deposit'=>null,'deposit_order_no'=>null]);
164 }catch (\Exception $exception){ 164 }catch (\Exception $exception){
165 $this->apiResponse(301,'数据库修改失败'); 165 $this->apiResponse(301,'数据库修改失败');
166 } 166 }