53 lines
1.0 KiB
PHP
53 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DistributionPreIncome extends Model
|
|
{
|
|
public const TYPE_PRICE_DIFF = 1;
|
|
public const TYPE_LEVEL_SAME = 2;
|
|
public const TYPE_LEVEL_DIFF = 3;
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'rule' => 'json',
|
|
'completed_at' => 'datetime',
|
|
];
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'user_id',
|
|
'order_id',
|
|
'type',
|
|
'agent_level',
|
|
'total_amount',
|
|
'total_sales_value',
|
|
'total_revenue',
|
|
'rule',
|
|
'status',
|
|
'remarks',
|
|
'rule',
|
|
'completed_at',
|
|
];
|
|
|
|
public static $typeTexts = [
|
|
self::TYPE_PRICE_DIFF => '推粉丝赚差价',
|
|
self::TYPE_LEVEL_SAME => '平级奖励',
|
|
self::TYPE_LEVEL_DIFF => '级差奖金',
|
|
];
|
|
|
|
/**
|
|
* 此预收益的变更记录
|
|
*/
|
|
public function logs()
|
|
{
|
|
return $this->hasMany(DistributionPreIncomeLog::class, 'pre_income_id');
|
|
}
|
|
}
|