no message
This commit is contained in:
parent
b73305311b
commit
9d0c32cdfd
@ -823,7 +823,7 @@ final class Cron
|
||||
$iPayClass = $_ENV["user_payClass"];
|
||||
|
||||
$pending_payment_orders = (new Order())->where('status', 'payment_pending')->get(); // 这里还是无脑检索order了,但是现在order表可以只保留一年内数据,问题不大
|
||||
// var_dump($pending_payment_orders);
|
||||
|
||||
$aUserInQueue = []; // 用户可能在5分钟之内多次下单,但一次只处理一个,坚固
|
||||
foreach ($pending_payment_orders as $oOrder) {
|
||||
|
||||
@ -831,28 +831,25 @@ final class Cron
|
||||
continue;
|
||||
}
|
||||
|
||||
$invoice = (new Invoice())->where('order_id', $oOrder->id)->first();
|
||||
|
||||
if ($invoice === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
//var_dump($aUserInQueue);
|
||||
try {
|
||||
|
||||
$invoice = (new Invoice())->where('order_id', $oOrder->id)->first();
|
||||
|
||||
if ($invoice === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
// var_dump($invoice->id);
|
||||
// var_dump($invoice->status);
|
||||
// 付款完成后
|
||||
if (in_array($invoice->status, ['paid_gateway', 'paid_balance', 'paid_admin'])) {
|
||||
// var_dump(111);
|
||||
|
||||
$oUser = User::find($invoice->user_id);
|
||||
|
||||
$iPayAmount = $invoice->price - $invoice->money_use;
|
||||
|
||||
if ($oOrder->product_code == "code") { // 钱包充值
|
||||
// var_dump(222);
|
||||
|
||||
$iUserMoneyOld = $oUser->money;
|
||||
$iUserMoneyNew = $oUser->money + $invoice->price;
|
||||
$iAmount = $invoice->price;
|
||||
@ -959,10 +956,10 @@ final class Cron
|
||||
|
||||
foreach ($oUserList as $oUser) {
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
// $oUser->isPayClass = $oUser->class >= $iPayClass ? true : false;
|
||||
|
||||
if (strtotime($oUser->class_expire) < time()) { // 时间到期
|
||||
@ -1014,10 +1011,10 @@ final class Cron
|
||||
continue; // 没有待激活就直接桡过,而不是报错
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
$oProduct = Product::where("code", $oPlanPending->product_code)->first(); // * 商品表
|
||||
|
||||
// 没有对应商品时
|
||||
@ -1129,10 +1126,10 @@ final class Cron
|
||||
continue;
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
//// 开始自动续订
|
||||
$iUserMoneyOld = $oUser->money;
|
||||
$iUserMoneyNew = $oUser->money - $oPlanActivated->user_price;
|
||||
@ -1233,10 +1230,10 @@ final class Cron
|
||||
foreach ($oPlanExpireQueueList as $oPlanExpireQueue)
|
||||
{
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
$oUser = User::where("id", $oPlanExpireQueue->user_id)->first();
|
||||
|
||||
//// activated转移到expired
|
||||
|
||||
Loading…
Reference in New Issue
Block a user