mirror of
https://github.com/v2board/v2board.git
synced 2025-06-13 21:28:27 +08:00
auto check commission
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user