支付完成,更新状态
This commit is contained in:
@@ -160,11 +160,13 @@ 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->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();
|
||||||
Db::name("student")->inc("hot_count", 1)->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.');
|
return $fail('Order not exists.');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ class Payment extends Model
|
|||||||
*/
|
*/
|
||||||
public function paid()
|
public function paid()
|
||||||
{
|
{
|
||||||
$this->orders()->save(['status' => 1]);
|
|
||||||
|
|
||||||
$this->paid_at = Carbon::now(); // 更新支付时间为当前时间
|
$this->paid_at = Carbon::now(); // 更新支付时间为当前时间
|
||||||
$this->status = 1;
|
$this->status = 1;
|
||||||
$this->save();
|
$this->save();
|
||||||
|
|||||||
Reference in New Issue
Block a user