request->post(); $model = new Vr(); $data = $model->getList($input); if (!empty($data['data'])) { foreach ($data['data'] as &$val) { $val['img'] = Yii::$app->params['httpImg']['host'] . Yii::$app->params['httpImg']['video'] . $val['img']; $val['create_at'] = date('Y-m-d H:i:s', $val['create_at']); } } return $data; } //数据设置 public function vrSet() { $input = Yii::$app->request->post(); $row = Vr::findOne($input['id']); switch ($input['code']) { case 'del': if ($row->delete()) { return true; } break; case 'sort': $row->sort = $input['val']; if ($row->update(false)) { return true; } break; case 'state': $row->state = $input['val']; if ($row->update(false)) { return true; } break; } return false; } }