'点击进入未展示', ]; /** * @inheritdoc */ public static function tableName() { return 'banner'; } /** * @inheritdoc */ public function rules() { return [ [['status', 'title', 'primaryKey', 'admin_id', 'admin_name', 'addtime', 'admin_ip', 'admin_agent', 'model', 'type', 'handle_id', 'result', 'describe'], 'required'], [['status', 'admin_id', 'addtime', 'handle_id'], 'integer'], [['result', 'describe'], 'string'], [['title', 'primaryKey', 'admin_name', 'admin_ip', 'admin_agent', 'model', 'type'], 'string', 'max' => 200], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'status' => 'Status', 'title' => 'Title', 'primaryKey' => 'Primary Key', 'admin_id' => 'Admin ID', 'admin_name' => 'Admin Name', 'addtime' => 'Addtime', 'admin_ip' => 'Admin Ip', 'admin_agent' => 'Admin Agent', 'model' => 'Model', 'type' => 'Type', 'handle_id' => 'Handle ID', 'result' => 'Result', 'describe' => 'Describe', ]; } public function searchById($id){ if (($model = Banner::findOne($id)) !== null) { return json_encode($model->toArray()); } else { throw new \yii\web\NotFoundHttpException('The requested page does not exist.'); } } }