作者 魏强
1 个管道 的构建 通过 耗费 0 秒

Merge branch 'master' of http://114.215.101.231:8099/root/sleep

... ... @@ -111,9 +111,11 @@ class AdminFaultAuditController extends AdminBaseController{
try{
Db::startTrans();
Db::name('users')->where('id',$fault['users_id'])->update(['is_use'=>0]);
Db::name('equipment')->where('name',$order['eq_name'])->update(['use'=>0]);
Db::name('order')->where('id',$order['id'])->update($data);
Db::name('fault')->where('id',$id)->update(['state'=>3]);
// if (!Db::name('order')->where(['eq_name'=>$order['eq_name'],'state'=>1])->find()){
Db::name('equipment')->where('name',$order['eq_name'])->update(['use'=>0]);
// }
}catch (\Exception $exception){
Db::rollback();
$this->error('错误:'.$exception->getMessage());
... ...
... ... @@ -579,6 +579,10 @@ class OrderController extends HomeBaseController{
*/
public function pay($order_no){
$order = Db::name('order')->where(['order_no' => $order_no, 'state' => 2])->find();
if ($order['price']==0){
Db::name('order')->where(['id'=>$order['id']])->update(['state'=>3]);
$this->apiResponse(200, '订单结算成功');
}
$user = Db::name('users')->where('id', $order['users_id'])->find();
$price = $order['price'] * 100;//订单价格
//微信直接支付
... ...