'按周', '20' => '按月', '30' => '按年']; return ['text' => $bonus_type[$value], 'value' => $value]; } public function getStartTimeAttr($value) { return date('Y-m-d', $value); } public function getEndTimeAttr($value) { return date('Y-m-d', $value); } /** *获取总额 */ public static function getBonusPriceByBonusId($bonusId) { return (new static())->where('bonus_id', '=', $bonusId) ->sum("bonus_price"); } }