You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

548 rivejä
22 KiB

  1. <?php
  2. namespace backend\modules\motorcade\controllers;
  3. use yii\imagine\Image;
  4. use Faker\Provider\Base;
  5. use kartik\form\ActiveForm;
  6. use Symfony\Component\DomCrawler\Field\InputFormField;
  7. use Symfony\Component\Yaml\Tests\B;
  8. use Yii;
  9. use backend\modules\motorcade\models\BaseBus;
  10. use backend\modules\motorcade\models\BusSearch;
  11. use yii\data\ActiveDataProvider;
  12. use yii\db\Query;
  13. use yii\web\NotFoundHttpException;
  14. use yii\filters\VerbFilter;
  15. use backend\modules\motorcade\models\BaseDocument;
  16. use common\models\zzcsUtils;
  17. use yii\web\UploadedFile;
  18. /**
  19. * BaseBusController implements the CRUD actions for BaseBus model.
  20. */
  21. class BaseBusController extends BaseController
  22. {
  23. public $layout = "@backend/modules/motorcade/views/layouts/iframe_new";
  24. /**
  25. * @inheritdoc
  26. */
  27. public function behaviors()
  28. {
  29. return [
  30. 'verbs' => [
  31. 'class' => VerbFilter::className(),
  32. 'actions' => [
  33. 'delete' => ['POST'],
  34. ],
  35. ],
  36. ];
  37. }
  38. /**
  39. * Lists all BaseBus models.
  40. * @return mixed
  41. */
  42. public function actionIndex()
  43. {
  44. $searchModel = new BusSearch();
  45. $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  46. return $this->render('index', [
  47. 'searchModel' => $searchModel,
  48. 'dataProvider' => $dataProvider,
  49. ]);
  50. }
  51. /**
  52. * Displays a single BaseBus model.
  53. * @param integer $id
  54. * @return mixed
  55. */
  56. public function actionView($id)
  57. {
  58. return $this->render('view', [
  59. 'model' => $this->findModel($id),
  60. ]);
  61. }
  62. /**
  63. * Creates a new BaseBus model.
  64. * If creation is successful, the browser will be redirected to the 'view' page.
  65. * @return mixed
  66. */
  67. public function actionCreate()
  68. {
  69. $model = new BaseBus();
  70. if ($model->load(Yii::$app->request->post()) && $model->save()) {
  71. return $this->redirect(['view', 'id' => $model->BUS_ID]);
  72. } else {
  73. return $this->render('create', [
  74. 'model' => $model,
  75. ]);
  76. }
  77. }
  78. /**
  79. * Updates an existing BaseBus model.
  80. * If update is successful, the browser will be redirected to the 'view' page.
  81. * @param integer $id
  82. * @return mixed
  83. */
  84. public function actionUpdate($id)
  85. {
  86. $model = $this->findModel($id);
  87. if ($model->load(Yii::$app->request->post()) && $model->save()) {
  88. return $this->redirect(['view', 'id' => $model->BUS_ID]);
  89. } else {
  90. return $this->render('update', [
  91. 'model' => $model,
  92. ]);
  93. }
  94. }
  95. /**
  96. * Deletes an existing BaseBus model.
  97. * If deletion is successful, the browser will be redirected to the 'index' page.
  98. * @param integer $id
  99. * @return mixed
  100. */
  101. public function actionDelete($id)
  102. {
  103. $this->findModel($id)->delete();
  104. return $this->redirect(['index']);
  105. }
  106. /**
  107. * Finds the BaseBus model based on its primary key value.
  108. * If the model is not found, a 404 HTTP exception will be thrown.
  109. * @param integer $id
  110. * @return BaseBus the loaded model
  111. * @throws NotFoundHttpException if the model cannot be found
  112. */
  113. protected function findModel($id)
  114. {
  115. if (($model = BaseBus::findOne($id)) !== null) {
  116. return $model;
  117. } else {
  118. throw new NotFoundHttpException('The requested page does not exist.');
  119. }
  120. }
  121. public function actionValidateForm () {
  122. Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
  123. $model = new BusSearch();//这里要替换成自己的模型类
  124. $model->setScenario('add_bus');
  125. $model->load(Yii::$app->request->post());
  126. return \yii\widgets\ActiveForm::validate($model);
  127. }
  128. public function actionAddBus()
  129. {
  130. $obj = new BusSearch(['scenario' => 'add_bus']);
  131. if (Yii::$app->request->isPost) {
  132. $obj->load(Yii::$app->request->post());
  133. $user_id = Yii::$app->user->id;
  134. $main_cooperation_id = Yii::$app->user->identity->MAIN_CORP_ID2;
  135. $bus_company = Yii::$app->user->identity->ORG_ID;
  136. if (in_array($obj['BUS_BELONG'], [523, 524])) {
  137. $obj['ORG_ID'] = $bus_company;
  138. }
  139. $obj['MAIN_CORP_ID'] = $main_cooperation_id;
  140. $obj['CREATE_USER_ID'] = $user_id;
  141. $obj['CREATE_TIME'] = date("Y-m-d H:i:s");
  142. $obj['FUEL_FORM'] = (int)$obj['FUEL_FORM'];
  143. if ($obj->save()) {
  144. Yii::$app-> session -> setFlash('success', '保存成功!');
  145. $tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'tab1';
  146. $this->redirect('/motorcade/base-bus/check-bus?bus_id=' . $obj->BUS_ID . '&tab=' . $tab);
  147. } else {
  148. Yii::$app->session->setFlash('error', '保存失败!');
  149. }
  150. }
  151. $seat_type = isset($_REQUEST['seat_type']) ? $_REQUEST['seat_type'] : '-1';
  152. $data = $obj->getSeatCount($seat_type);
  153. return $this->render('base_bus', ['data' => $data, 'view' => '_addBus']);
  154. }
  155. // 查看车辆
  156. public function actionCheckBus($bus_id, $tab = '')
  157. {
  158. //获取是查看车辆还是修改车辆 为modify则为修改
  159. $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
  160. //初始页选择
  161. $tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : '';
  162. $obj = $this->findModel($bus_id);
  163. if (Yii::$app->request->isPost) {
  164. $OLD_BUS_TYPE_RES_ID = $obj['BUS_TYPE_RES_ID'];
  165. $obj->load(Yii::$app->request->post());
  166. $user_id = Yii::$app->user->id;
  167. $bus_company = Yii::$app->user->identity->ORG_ID;
  168. //修改车辆 SEAT_TYPE BUS_TYPE_RES_ID $seat_desc $seat_count
  169. $tmp_seat_type = $obj['SEAT_TYPE'];
  170. $tmp_seat_count = $obj['BUS_TYPE_RES_ID'];
  171. $tmp_seat_count1 = BusSearch::getModifySeatCount($tmp_seat_count)['res_name'];
  172. $seat_desc = BusSearch::getModifySeatType($tmp_seat_type)['type_name'] . $tmp_seat_count1;
  173. $seat_count = mb_substr($tmp_seat_count1, 0, strlen($tmp_seat_count1) - 3);
  174. if ($OLD_BUS_TYPE_RES_ID != $obj['BUS_TYPE_RES_ID']) {//如果座位数量 发送变更则断开与新座位图之间的联系
  175. $obj['SEAT_MATRIX_ID'] = 0;
  176. }
  177. $obj['SEAT_DESC'] = $seat_desc;
  178. $obj['SEAT_COUNT'] = $seat_count;
  179. //end 修改
  180. if (in_array($obj['BUS_BELONG'], [523, 524])) {
  181. $obj['ORG_ID'] = $bus_company;
  182. }
  183. $obj['CREATE_USER_ID'] = $user_id;
  184. $obj['CREATE_TIME'] = date("Y-m-d H:i:s");
  185. if ($obj->save()) {
  186. Yii::$app->session->setFlash('success', '保存成功!');
  187. } else {
  188. Yii::$app->session->setFlash('error', '保存失败!');
  189. };
  190. return $this->redirect(['/motorcade/base-bus/check-bus?bus_id=' . $obj->BUS_ID . '&tab=' . $tab . '&op=' . $op]);
  191. }
  192. $seat_type = isset($_REQUEST['seat_type']) ? $_REQUEST['seat_type'] : $obj['SEAT_TYPE'];
  193. $bus_id = isset($_REQUEST['bus_id']) ? $_REQUEST['bus_id'] : '-1';
  194. //获取座位数信息
  195. $data = $obj->getSeatCount($seat_type);
  196. //保单列表
  197. $dataProvider = new ActiveDataProvider([
  198. 'query' => BaseDocument::find()
  199. ->where(['CANCEL_FLAG' => 0, 'DOC_STATUS' => BaseDocument::STATUS_ID_ACTIVE, 'DOC_TYPE' => BaseDocument::BUS, 'DOC_ID' => $bus_id, 'DOC_OPTION' => [511, 512, 513,514]]),
  200. 'pagination' => [
  201. 'pageSize' => 20,
  202. ],
  203. 'sort' => [
  204. 'attributes' => [
  205. 'EXPIRE_DATE'
  206. ],
  207. 'defaultOrder' =>
  208. [
  209. 'EXPIRE_DATE' => SORT_DESC,
  210. ],
  211. ]
  212. ]);
  213. //保养列表
  214. $dataProvider1 = new ActiveDataProvider([
  215. 'query' => BaseDocument::find()
  216. ->where(['CANCEL_FLAG' => 0, 'DOC_TYPE' => BaseDocument::BUS, 'PID' => 0, 'DOC_ID' => $bus_id, 'DOC_OPTION' => [BaseDocument::MAINTAIN,BaseDocument::LICENCE_WX],'DOC_STATUS'=>0,'MT_STATUS'=>BaseDocument::WANCHENG]),
  217. 'pagination' => [
  218. 'pageSize' => 20,
  219. ],
  220. ]);
  221. return $this->render('base_bus', ['dataProvider1' => $dataProvider1, 'data' => $data, 'view' => '_checkBus', 'id' => $bus_id, 'model' => $obj, 'dataProvider' => $dataProvider, 'op' => $op, 'tab' => $tab]);
  222. }
  223. //修改
  224. /**
  225. * User: wangxj
  226. *
  227. * 车辆道路许可证等
  228. *
  229. * @params
  230. *
  231. * @return
  232. */
  233. public function action_image($id)
  234. {
  235. $result = false;
  236. $model = $this->findModel($id);
  237. if ($model === null) {
  238. throw new NotFoundHttpException('The requested page does not exist.');
  239. }
  240. $documents = Yii::$app->request->post('BaseDocument');
  241. //506 507 509 510
  242. foreach ($documents as $key => $document) {
  243. $expire_date = '';
  244. $start_date = '';
  245. $docArray = [];
  246. foreach ($document as $index => $item) {
  247. if (isset($item['ID']) && $item['ID'] != '') {
  248. $new = BaseDocument::findOne($item['ID']);
  249. $new->setScenario('bus');
  250. } else
  251. $new = new BaseDocument(['scenario' => 'bus']);
  252. //设置有效期
  253. if ($expire_date == '') {
  254. $expire_date = isset($item['EXPIRE_DATE']) ? $item['EXPIRE_DATE'] : '';
  255. $start_date = isset($item['START_DATE']) ? $item['START_DATE'] : '';
  256. } else {
  257. $item['EXPIRE_DATE'] = $expire_date;
  258. $item['START_DATE'] = $start_date;
  259. }
  260. $new->setAttributes($item);
  261. $new->DOC_ID = $id;
  262. $new->DOC_STATUS = 0;
  263. //保存图片 可以研究一下
  264. // \GuzzleHttp\Psr7\UploadedFile::
  265. @$img_url = $_FILES['BaseDocument']['name'][$key][$index]['IMG_URL'];
  266. if ($img_url && $img_url != '' && $img_url != Yii::$app->params['motorcadeDefaultImage']) {
  267. $new->image = UploadedFile::getInstances($new, "[$key][$index]IMG_URL");
  268. $base_path = Yii::$app->basePath . '/web' . Yii::$app->params['motorcadeImagePath'];
  269. // 如果路径中的文件夹不存在,则新建这一文件夹
  270. if (!is_dir($base_path)) {
  271. mkdir($base_path, 0777);
  272. }
  273. ini_set("memory_limit", "-1"); //图片分辨率生成缩略图时,会占用内存,这里设置无限制
  274. //获取文件名
  275. $file_name = zzcsUtils::initFileName($base_path, '.' . $new->image[0]->extension);
  276. $new->image[0]->saveAs($base_path . $file_name);
  277. $thumbnail_prefix = BaseDocument::THUMBNAIL_WIDTH . 'x' . BaseDocument::THUMBNAIL_HEIGHT;
  278. Image::thumbnail($base_path . $file_name, BaseDocument::THUMBNAIL_WIDTH, BaseDocument::THUMBNAIL_HEIGHT)
  279. ->save(
  280. $base_path . $thumbnail_prefix . '_' . $file_name,
  281. ['quality' => BaseDocument::THUMBNAIL_QUALITY]);
  282. $new->IMG_THUMBNAIL = Yii::$app->params['motorcadeImagePath'] . $thumbnail_prefix . '_' . $file_name;
  283. $new->IMG_URL = Yii::$app->params['motorcadeImagePath'] . $file_name;
  284. }
  285. $docArray[] = $new;
  286. }
  287. foreach ($docArray as $item) {
  288. // //设置之前的cancel_flag为1
  289. // $oldOne = BaseDocument::findOne(['DOC_TYPE' => BaseDocument::DRIVER, 'DOC_ID' => $item->DOC_ID, 'DOC_OPTION' => $item->DOC_OPTION, 'IMG_OPTION' => $item->IMG_OPTION,]);
  290. // if ($oldOne !== null) {
  291. // $oldOne->delete();
  292. // }
  293. if ($item->save()) {
  294. $result = true;
  295. }
  296. }
  297. }
  298. if ($result) {
  299. Yii::$app->session->setFlash('success', '保存成功!');
  300. $this->redirect('/motorcade/base-bus/check-bus?bus_id=' . $id . '&tab=tab2');
  301. } else {
  302. Yii::$app->session->setFlash('error', '保存失败!');
  303. return false;
  304. }
  305. // return $this->redirect("/motorcade/driver/update?id=$id&act=doc");
  306. }
  307. public function actionGetMaintain()
  308. {
  309. $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : '';
  310. $bus_id = isset($_REQUEST['bus_id']) ? $_REQUEST['bus_id'] : '';
  311. // wb 为515 为保养 为589为维修 默认为保养;
  312. $wb = isset($_REQUEST['wb'])?$_REQUEST['wb']:515;
  313. //end 表单提交
  314. //有bus_id则为添加,有id则为修改
  315. if ($id == '') {
  316. $model[] = new BaseDocument(['scenario' => 'bus-maintain']);
  317. $model[] = new BaseDocument(['scenario' => 'bus-maintain']);
  318. } else {
  319. $tmp = BaseDocument::findOne($id);
  320. $model = BaseDocument::find()->where(['DOC_TYPE' => BaseDocument::BUS, 'CANCEL_FLAG' => 0, 'DOC_OPTION' => $wb])->andWhere(['or', ['ID' => $id], ['PID' => $id]])->all();
  321. }
  322. return $this->render('_images_maintain', ['model' => $model, 'id' => $id, 'bus_id' => $bus_id,'wb'=>$wb]);
  323. }
  324. public function action_maintain_image($id)
  325. {
  326. $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
  327. //获取处理完成后的tab页
  328. $tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'tab1';
  329. //表单提交
  330. $result = false;
  331. $model = $this->findModel($id);
  332. if ($model === null) {
  333. throw new NotFoundHttpException('The requested page does not exist.');
  334. }
  335. $documents = Yii::$app->request->post('BaseDocument');
  336. $pid = 0;
  337. foreach ($documents as $key => $document) {
  338. $expire_date = '';
  339. $start_date = '';
  340. $doc_man = '';
  341. $licheng = '';
  342. $res_id = '';
  343. $value = '';
  344. $docArray = [];
  345. foreach ($document as $index => $item) {
  346. if (isset($item['ID']) && $item['ID'] != '') {
  347. $new = BaseDocument::findOne($item['ID']);
  348. $new->setScenario('bus-maintain');
  349. } else
  350. $new = new BaseDocument(['scenario' => 'bus-maintain']);
  351. //设置有效期
  352. if ($expire_date == '') {
  353. $expire_date = isset($item['EXPIRE_DATE']) ? $item['EXPIRE_DATE'] : '';
  354. $start_date = isset($item['START_DATE']) ? $item['START_DATE'] : $start_date;
  355. $item['START_DATE'] = isset($item['START_DATE']) ? $item['START_DATE'] : $start_date;
  356. } else {
  357. $item['EXPIRE_DATE'] = $expire_date;
  358. $item['START_DATE'] = $start_date;
  359. }
  360. if ($doc_man == '') {
  361. $doc_man = isset($item['NAME']) ? $item['NAME'] : '';
  362. } else {
  363. $item['NAME'] = $doc_man;
  364. }
  365. if ($licheng == '') {
  366. $licheng = isset($item['LAST_MAINTAIN']) ? $item['LAST_MAINTAIN'] : '';
  367. } else {
  368. $item['LAST_MAINTAIN'] = $licheng;
  369. }
  370. if ($res_id == '') {
  371. $res_id = isset($item['RES_ID']) ? $item['RES_ID'] : '';
  372. } else {
  373. $item['RES_ID'] = $res_id;
  374. }
  375. if ($value == '') {
  376. $value = isset($item['VALUE']) ? $item['VALUE'] : '';
  377. } else {
  378. $item['VALUE'] = $value;
  379. }
  380. $new->setAttributes($item);
  381. $new->DOC_ID = $id;
  382. $new->DOC_STATUS = 0;
  383. $new->MT_STATUS = BaseDocument::WANCHENG;
  384. //保存图片 可以研究一下
  385. // \GuzzleHttp\Psr7\UploadedFile::
  386. @$img_url = $_FILES['BaseDocument']['name'][$key][$index]['IMG_URL'];
  387. if ($img_url && $img_url != '' && $img_url != Yii::$app->params['motorcadeDefaultImage']) {
  388. $new->image = UploadedFile::getInstances($new, "[$key][$index]IMG_URL");
  389. $base_path = Yii::$app->basePath . '/web' . Yii::$app->params['motorcadeImagePath'];
  390. // 如果路径中的文件夹不存在,则新建这一文件夹
  391. if (!is_dir($base_path)) {
  392. mkdir($base_path, 0777);
  393. }
  394. ini_set("memory_limit", "-1");
  395. //获取文件名
  396. $file_name = zzcsUtils::initFileName($base_path, '.' . $new->image[0]->extension);
  397. $new->image[0]->saveAs($base_path . $file_name);
  398. $thumbnail_prefix = BaseDocument::THUMBNAIL_WIDTH . 'x' . BaseDocument::THUMBNAIL_HEIGHT;
  399. Image::thumbnail($base_path . $file_name, BaseDocument::THUMBNAIL_WIDTH, BaseDocument::THUMBNAIL_HEIGHT)
  400. ->save(
  401. $base_path . $thumbnail_prefix . '_' . $file_name,
  402. ['quality' => BaseDocument::THUMBNAIL_QUALITY]);
  403. $new->IMG_THUMBNAIL = Yii::$app->params['motorcadeImagePath'] . $thumbnail_prefix . '_' . $file_name;
  404. $new->IMG_URL = Yii::$app->params['motorcadeImagePath'] . $file_name;
  405. }
  406. $docArray[] = $new;
  407. }
  408. foreach ($docArray as $item) {
  409. // //设置之前的cancel_flag为1
  410. // $oldOne = BaseDocument::findOne(['DOC_TYPE' => BaseDocument::DRIVER, 'DOC_ID' => $item->DOC_ID, 'DOC_OPTION' => $item->DOC_OPTION, 'IMG_OPTION' => $item->IMG_OPTION,]);
  411. // if ($oldOne !== null) {
  412. // $oldOne->delete();
  413. // }
  414. $item['PID'] = $pid;
  415. if ($item->save()) {
  416. $pid = $item['ID'];
  417. $result = true;
  418. }
  419. }
  420. }
  421. if ($result) {
  422. Yii::$app->session->setFlash('success', '保存成功!');
  423. } else {
  424. Yii::$app->session->setFlash('error', '保存失败!');
  425. }
  426. if ($op=='list'||$op=='detail'){
  427. return "<script>pjaxFinish('修改成功');</script>";
  428. }else{
  429. return $this->redirect("/motorcade/base-bus/check-bus?bus_id=$id&tab=$tab");
  430. }
  431. }
  432. /**
  433. * User: wangxj
  434. *
  435. * 加载保单数据
  436. *
  437. * @params $id integer
  438. *
  439. * @return string
  440. */
  441. public function action_image_insurance($id = '', $doc_id = '', $tab = 'tab2')
  442. {
  443. //保存保险
  444. if (Yii::$app->request->isPost) {
  445. $data = Yii::$app->request->post('BaseDocument');
  446. if ($data['ID'] == '') {
  447. $model = new BaseDocument(['scenario' => 'bus-insurance']);
  448. } else {
  449. $model = BaseDocument::findOne($id);
  450. $model->setScenario('bus-insurance');
  451. }
  452. $model->load(Yii::$app->request->post());
  453. if ($model->validate()) {
  454. @$img_url = $_FILES['BaseDocument']['name']['IMG_URL'];
  455. $model->DOC_STATUS = 0;
  456. if ($img_url && $img_url != '' && $img_url != Yii::$app->params['motorcadeDefaultImage']) {
  457. $model->image = UploadedFile::getInstances($model, "IMG_URL");
  458. $base_path = Yii::$app->basePath . '/web' . Yii::$app->params['motorcadeImagePath'];
  459. // 如果路径中的文件夹不存在,则新建这一文件夹
  460. if (!is_dir($base_path)) {
  461. mkdir($base_path, 0777);
  462. }
  463. ini_set("memory_limit", "-1");
  464. //获取文件名
  465. $file_name = zzcsUtils::initFileName($base_path, '.' . $model->image[0]->extension);
  466. $model->image[0]->saveAs($base_path . $file_name);
  467. $thumbnail_prefix = BaseDocument::THUMBNAIL_WIDTH . 'x' . BaseDocument::THUMBNAIL_HEIGHT;
  468. Image::thumbnail($base_path . $file_name, BaseDocument::THUMBNAIL_WIDTH, BaseDocument::THUMBNAIL_HEIGHT)
  469. ->save(
  470. $base_path . $thumbnail_prefix . '_' . $file_name,
  471. ['quality' => BaseDocument::THUMBNAIL_QUALITY]);
  472. $model->IMG_THUMBNAIL = Yii::$app->params['motorcadeImagePath'] . $thumbnail_prefix . '_' . $file_name;
  473. $model->IMG_URL = Yii::$app->params['motorcadeImagePath'] . $file_name;
  474. }
  475. Yii::$app->session->setFlash('success', '保存成功');
  476. $model->save();
  477. $this->redirect('/motorcade/base-bus/check-bus?bus_id=' . $model->DOC_ID . '&tab=' . $tab);
  478. } else {
  479. foreach ($model->getErrors() as $error):
  480. Yii::$app->session->setFlash('error', $error);
  481. endforeach;
  482. return $this->render('_images_insurance', ['model' => $model, 'DOC_ID' => $doc_id]);
  483. }
  484. } elseif (Yii::$app->request->isAjax) {
  485. $model = BaseDocument::findOne($id);
  486. if ($model == null) {
  487. $model = new BaseDocument(['scenario' => 'bus-insurance']);
  488. } else {
  489. $model->setScenario('bus-insurance');
  490. }
  491. return $this->render('_images_insurance', ['model' => $model, 'DOC_ID' => $doc_id]);
  492. }
  493. }
  494. // public function actionSeatType()
  495. // {
  496. // return $this->render('_checkBus',['seat_type'=>$_REQUEST['seat_type']]);
  497. // }
  498. //删除保单,或保险
  499. public function actionMaintainDelete($id, $bus_id, $tab)
  500. {
  501. $model = BaseDocument::updateAll(['CANCEL_FLAG' => 1], ['or', ['ID' => $id], ['PID' => $id]]);
  502. if ($model != 0) {
  503. Yii::$app->session->setFlash('success', '删除成功');
  504. } else {
  505. Yii::$app->session->setFlash('warning', '删除失败');
  506. }
  507. return $this->redirect(['/motorcade/base-bus/check-bus?bus_id=' . $bus_id . '&tab=' . $tab]);
  508. }
  509. }