|
@@ -7,6 +7,7 @@ use app\model\MemberAccount;
|
|
use app\model\Order;
|
|
use app\model\Order;
|
|
use app\model\PayDetail;
|
|
use app\model\PayDetail;
|
|
use support\Db;
|
|
use support\Db;
|
|
|
|
+use support\Log;
|
|
use Symfony\Component\Console\Command\Command;
|
|
use Symfony\Component\Console\Command\Command;
|
|
use Symfony\Component\Console\Input\InputArgument;
|
|
use Symfony\Component\Console\Input\InputArgument;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
@@ -32,9 +33,8 @@ class WelfareAccountCommand extends Command
|
|
$accounts = MemberAccount::where('member_account_classify','WELFARE')->get()->toArray();
|
|
$accounts = MemberAccount::where('member_account_classify','WELFARE')->get()->toArray();
|
|
Db::beginTransaction();
|
|
Db::beginTransaction();
|
|
try{
|
|
try{
|
|
-
|
|
|
|
foreach($accounts as $account){
|
|
foreach($accounts as $account){
|
|
- if ($account['member_account_income'] == '0.00'){
|
|
|
|
|
|
+ if ($account['member_account_income'] == '0.00' || $account['member_account_surplus'] == '0.00'){
|
|
echo "会员【" . $account['join_account_member_id'] . "】跳过\n";
|
|
echo "会员【" . $account['join_account_member_id'] . "】跳过\n";
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -46,6 +46,9 @@ class WelfareAccountCommand extends Command
|
|
|
|
|
|
// 插入清零记录
|
|
// 插入清零记录
|
|
$this->generatePayDetail($account);
|
|
$this->generatePayDetail($account);
|
|
|
|
+ // 记录日志
|
|
|
|
+ Log::info("会员【" . $account['join_account_member_id'] . "】清除福利已完成",$account);
|
|
|
|
+
|
|
echo "会员【" . $account['join_account_member_id'] . "】已处理完成\n";
|
|
echo "会员【" . $account['join_account_member_id'] . "】已处理完成\n";
|
|
}
|
|
}
|
|
Db::commit();
|
|
Db::commit();
|
|
@@ -55,8 +58,8 @@ class WelfareAccountCommand extends Command
|
|
dump($e->getMessage());
|
|
dump($e->getMessage());
|
|
|
|
|
|
Db::rollBack();
|
|
Db::rollBack();
|
|
|
|
+ return self::SUCCESS;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|