request->param('create_time_start', ''); $end_time = $this->request->param('create_time_end', ''); if ($start_time && $end_time) { $_op = $this->whereTime('create_time', '>=', strtotime($start_time)); $_op->whereTime('create_time', '<=', strtotime('+1 day', strtotime($end_time))); } return parent::parentLists(!empty($_op) ? $_op : ''); } /** * 读取后 * @param Model $model * @return bool|void */ public static function onAfterRead(Model $model) { if (in_array(request()->action(), ['edit', 'delete', 'status'])) { return true; } $model->offsetSet('action_ip', long2ip((int)$model->getAttr('action_ip'))); } }