setName('dayUserValue') ->addArgument('dayValue', Argument::OPTIONAL, 'php think menu [1] / [2]') ->setDescription('用户贡献度根据增值积分转化'); } protected function execute(Input $input, Output $output) { try { $user = userModel::getDB()->where('status', 1)->select()->toArray(); foreach ($user as $k => $v) { if ($v['all_value'] > 0) { $growth_num = bcdiv($v['all_value'], $v['growth_rate'], 2); userModel::getDB() ->where('uid', $v['uid']) ->update(['all_value' => 0, 'brokerage_price' => $growth_num]); } } } catch (\Exception $e) { print_r($e->getMessage()); } echo 'ok'; } }