lock(true) ->find(); if(!$payment){ Db::rollback(); $this->result([],400); } user_log("payment/{$payment['order_no']}",[ 'input'=>input(), '$_post'=>$_POST ]); $service=new PayReturnService(); $service->setPayment($payment); list($isPay,$succ)=$service->process(); user_log("payment/{$payment['order_no']}",compact('isPay','succ')); if(!$payment['pay_time'] && $isPay){ $payment->payed(); } Db::commit(); if(!$isPay){ $this->result($succ,400); } return $succ; } }