2021-06-21 02:01:26 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BonusLogs extends NexusModel
|
|
|
|
|
{
|
|
|
|
|
protected $table = 'bonus_logs';
|
|
|
|
|
|
|
|
|
|
protected $fillable = ['uid', 'business_type', 'old_total_value', 'value', 'new_total_value', 'comment'];
|
|
|
|
|
|
|
|
|
|
const DEFAULT_BONUS_CANCEL_ONE_HIT_AND_RUN = 10000;
|
|
|
|
|
|
|
|
|
|
const BUSINESS_TYPE_CANCEL_HIT_AND_RUN = 1;
|
2022-01-19 23:54:55 +08:00
|
|
|
const BUSINESS_TYPE_BUY_MEDAL = 2;
|
2021-06-21 02:01:26 +08:00
|
|
|
|
|
|
|
|
public static $businessTypes = [
|
|
|
|
|
self::BUSINESS_TYPE_CANCEL_HIT_AND_RUN => ['text' => 'Cancel H&R'],
|
2022-01-19 23:54:55 +08:00
|
|
|
self::BUSINESS_TYPE_BUY_MEDAL => ['text' => 'Buy medal'],
|
2021-06-21 02:01:26 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public static function getBonusForCancelHitAndRun()
|
|
|
|
|
{
|
|
|
|
|
$result = Setting::get('bonus.cancel_hr');
|
|
|
|
|
return $result ?? self::DEFAULT_BONUS_CANCEL_ONE_HIT_AND_RUN;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|