支付完成回调处理

This commit is contained in:
2022-09-15 17:09:09 +08:00
parent ee6d826334
commit 85fb0dc23d
2 changed files with 6 additions and 4 deletions

View File

@@ -159,10 +159,7 @@ class Wechat
//订单支付成功。查询用户信息 //订单支付成功。查询用户信息
$order_detail = \app\model\Order::where("id", $order->order_id)->find(); $order_detail = \app\model\Order::where("id", $order->order_id)->find();
$order_detail->paid();
$order_detail->status = 1;
$order_detail->save();
//为用户增加助力值 //为用户增加助力值
$zhuLi = env("ZHULI_VALUE") ?? 150; $zhuLi = env("ZHULI_VALUE") ?? 150;
Db::name("student")->inc("hot", $zhuLi)->where("id", $order_detail->id)->update(); Db::name("student")->inc("hot", $zhuLi)->where("id", $order_detail->id)->update();

View File

@@ -7,4 +7,9 @@ use think\Model;
class Order extends Model class Order extends Model
{ {
protected $autoWriteTimestamp = true; protected $autoWriteTimestamp = true;
public function paid(){
$this->status = 1;
$this->save();
}
} }