'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 scopePending($query) { return $query->where('status', '=', 0); } /** * 此预收益的变更记录 */ public function logs() { return $this->hasMany(DistributionPreIncomeLog::class, 'pre_income_id'); } }