mirror of
https://github.com/v2board/v2board.git
synced 2025-02-11 16:00:27 +08:00
auto check commission
This commit is contained in:
parent
890626d892
commit
998ac1d500
@ -38,6 +38,25 @@ class CheckCommission extends Command
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle()
|
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)
|
$order = Order::where('commission_status', 1)
|
||||||
->where('status', 3)
|
->where('status', 3)
|
||||||
|
@ -30,7 +30,8 @@ class ConfigController extends Controller
|
|||||||
'invite_commission' => config('v2board.invite_commission', 10),
|
'invite_commission' => config('v2board.invite_commission', 10),
|
||||||
'invite_gen_limit' => config('v2board.invite_gen_limit', 5),
|
'invite_gen_limit' => config('v2board.invite_gen_limit', 5),
|
||||||
'invite_never_expire' => config('v2board.invite_never_expire', 0),
|
'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' => [
|
'site' => [
|
||||||
'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0),
|
'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0),
|
||||||
|
@ -14,6 +14,7 @@ class ConfigSave extends FormRequest
|
|||||||
'invite_gen_limit' => 'integer',
|
'invite_gen_limit' => 'integer',
|
||||||
'invite_never_expire' => 'in:0,1',
|
'invite_never_expire' => 'in:0,1',
|
||||||
'commission_first_time_enable' => 'in:0,1',
|
'commission_first_time_enable' => 'in:0,1',
|
||||||
|
'commission_auto_check_enable' => 'in:0,1',
|
||||||
// site
|
// site
|
||||||
'stop_register' => 'in:0,1',
|
'stop_register' => 'in:0,1',
|
||||||
'email_verify' => 'in:0,1',
|
'email_verify' => 'in:0,1',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user