From ee6d826334b88e11d8c9aa844d6249b92b7e9528 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 15 Sep 2022 17:05:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=8C=E6=88=90=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Wechat.php | 4 +++- app/model/Payment.php | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controller/Wechat.php b/app/controller/Wechat.php index c58e033..442a308 100644 --- a/app/controller/Wechat.php +++ b/app/controller/Wechat.php @@ -160,11 +160,13 @@ class Wechat //订单支付成功。查询用户信息 $order_detail = \app\model\Order::where("id", $order->order_id)->find(); + $order_detail->status = 1; + $order_detail->save(); + //为用户增加助力值 $zhuLi = env("ZHULI_VALUE") ?? 150; Db::name("student")->inc("hot", $zhuLi)->where("id", $order_detail->id)->update(); Db::name("student")->inc("hot_count", 1)->where("id", $order_detail->id)->update(); - return true; } return $fail('Order not exists.'); }); diff --git a/app/model/Payment.php b/app/model/Payment.php index 6190eba..7868cf9 100644 --- a/app/model/Payment.php +++ b/app/model/Payment.php @@ -23,8 +23,6 @@ class Payment extends Model */ public function paid() { - $this->orders()->save(['status' => 1]); - $this->paid_at = Carbon::now(); // 更新支付时间为当前时间 $this->status = 1; $this->save();