first commit

This commit is contained in:
Your Name
2026-01-19 14:19:22 +08:00
commit fe2d9c1868
4777 changed files with 665503 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace app\common\command;
use app\common\model\finance\UserFinance;
use think\console\{Command,Output,Input};
use think\facade\{Db,Log};
class UnfreezeFunds extends Command
{
protected function configure()
{
$this->setName('unfreeze_funds')
->setDescription('用户资金释放');
}
protected function execute(Input $input, Output $output)
{
Db::startTrans();
try {
$nowTime = time();
$lists = UserFinance::where(['frozen' => 1])
->where("thaw_time < $nowTime")
->order(['id' => 'desc'])
->select()
->toArray();
foreach ($lists as &$item) {
UserFinance::update([
'id' => $item['id'],
'frozen' => 0,
]);
}
Db::commit();
} catch (\Exception $e) {
Db::rollback();
Log::write('失败原因:' . $e->getMessage());
return false;
}
}
}