mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
auto check commission
This commit is contained in:
parent
890626d892
commit
998ac1d500
@ -38,6 +38,25 @@ class CheckCommission extends Command
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->autoCheck();
|
||||
$this->autoPayCommission();
|
||||
}
|
||||
|
||||
public function autoCheck()
|
||||
{
|
||||
if ((int)config('v2board.commission_auto_check_enable')) {
|
||||
Order::where('commission_status', 0)
|
||||
->where('status', 3)
|
||||
->where('commission_balance', '>', 0)
|
||||
->where('updated_at', '>=', strtotime('+3 day', time()))
|
||||
->update([
|
||||
'commission_status' => 1
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function autoPayCommission()
|
||||
{
|
||||
$order = Order::where('commission_status', 1)
|
||||
->where('status', 3)
|
||||
|
@ -30,7 +30,8 @@ class ConfigController extends Controller
|
||||
'invite_commission' => config('v2board.invite_commission', 10),
|
||||
'invite_gen_limit' => config('v2board.invite_gen_limit', 5),
|
||||
'invite_never_expire' => config('v2board.invite_never_expire', 0),
|
||||
'commission_first_time_enable' => config('v2board.commission_first_time_enable', 1)
|
||||
'commission_first_time_enable' => config('v2board.commission_first_time_enable', 1),
|
||||
'commission_auto_check' => config('v2board.commission_auto_check_enable', 1)
|
||||
],
|
||||
'site' => [
|
||||
'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0),
|
||||
|
@ -14,6 +14,7 @@ class ConfigSave extends FormRequest
|
||||
'invite_gen_limit' => 'integer',
|
||||
'invite_never_expire' => 'in:0,1',
|
||||
'commission_first_time_enable' => 'in:0,1',
|
||||
'commission_auto_check_enable' => 'in:0,1',
|
||||
// site
|
||||
'stop_register' => 'in:0,1',
|
||||
'email_verify' => 'in:0,1',
|
||||
|
Loading…
Reference in New Issue
Block a user