hasOne(Shop::class, 'id', 'shop_id') ->field(['id','logo','type','name'])->append(['type_desc']); } /** * @notes 直播时间描述 * @param $value * @param $data * @return string * @author 段誉 * @date 2023/2/16 9:39 */ public function getLiveTimeTextAttr($value, $data) { $start = !empty($data['start_time']) ? date('m月d日 H:i', $data['start_time']) : ''; $end = !empty($data['end_time']) ? date('m月d日 H:i', $data['end_time']) : ''; return $start . '~' . $end; } /** * @notes 审核状态描述 * @param $value * @param $data * @return string|string[] * @author 段誉 * @date 2023/2/16 9:45 */ public function getAuditStatusTextAttr($value, $data) { return LiveRoomEnum::getAuditStatusDesc($data['audit_status']); } /** * @notes 直播状态描述 * @param $value * @param $data * @return string|string[] * @author 段誉 * @date 2023/2/16 9:48 */ public function getLiveStatusTextAttr($value, $data) { return LiveRoomEnum::getLiveStatusDesc($data['live_status']); } }