定时任务新增逻辑

main
limu 9 months ago
parent ebea857792
commit ef19adbb26
  1. 10
      app/command/dayUserGrowth.php

@ -4,6 +4,7 @@ declare (strict_types=1);
namespace app\command; namespace app\command;
use app\common\model\user\ValueContributionLog;
use Swoole\Coroutine\MySQL\Exception; use Swoole\Coroutine\MySQL\Exception;
use think\console\Command; use think\console\Command;
use think\console\Input; use think\console\Input;
@ -36,6 +37,15 @@ class dayUserGrowth extends Command
foreach ($user as $k => $v) { foreach ($user as $k => $v) {
if ($v['all_value'] > 0) { if ($v['all_value'] > 0) {
$growth_num = bcdiv($v['all_value'], $v['growth_rate'], 2); $growth_num = bcdiv($v['all_value'], $v['growth_rate'], 2);
//加到log日志
ValueContributionLog::getDB()->insert([
'type' => 9,
'types_of' => 1,
'num' => $growth_num,
'ctime' => date('Y-m-d H:i:s'),
'memo' => '贡献值转化增值积分',
'user_id' => $v['uid'],
]);
$growth_num = $growth_num+$v['brokerage_price']; $growth_num = $growth_num+$v['brokerage_price'];
userModel::getDB() userModel::getDB()
->where('uid', $v['uid']) ->where('uid', $v['uid'])

Loading…
Cancel
Save