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

order

... ... @@ -92,7 +92,7 @@ class UsersController extends HomeBaseController{
*/
public function payDeposit(){
$users_id=$this->request->param('users_id');
$users=Db::name('users')->where('users_id',$users_id)->find();
$users=Db::name('users')->where('id',$users_id)->find();
$openId=$users['open_id'];
$order_no = cmf_get_order_sn();
$body="押金-支付";
... ... @@ -102,7 +102,7 @@ class UsersController extends HomeBaseController{
$data=$wxPay->pay();
if (isset($data['package'])){
try{
Db::name('users')->where(['users_id'=>$users_id])->update(['deposit_order_no'=>$order_no]);
Db::name('users')->where(['id'=>$users_id])->update(['deposit_order_no'=>$order_no]);
}catch (\Exception $exception){
}
... ... @@ -155,12 +155,12 @@ class UsersController extends HomeBaseController{
*/
public function refundDeposit(){
$users_id=$this->request->param('users_id');
$users=Db::name('users')->where('users_id',$users_id)->find();
$users=Db::name('users')->where('id',$users_id)->find();
$orderNo=$users['deposit_order_no'];//需要退款的订单
$price=$users['deposit'];
Db::startTrans();
try{
Db::name('users')->where('users_id',$users_id)->update(['is_deposit'=>0,'deposit'=>null,'deposit_order_no'=>null]);
Db::name('users')->where('id',$users_id)->update(['is_deposit'=>0,'deposit'=>null,'deposit_order_no'=>null]);
}catch (\Exception $exception){
$this->apiResponse(301,'数据库修改失败');
}
... ...