diff --git a/.gitignore b/.gitignore index 346d3b2..9cbd357 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ composer.phar phpunit.phar # local phpunit config /phpunit.xml +frontend/web/upload diff --git a/common/models/CarT.php b/common/models/CarT.php index aa830ca..ae9159e 100644 --- a/common/models/CarT.php +++ b/common/models/CarT.php @@ -121,6 +121,10 @@ class CarT extends \common\models\Base ]; } + public function getLinkmen() { + return $this->hasMany(LinkmanT::className(),['car_id'=>'id']); + } + public function getUser() { return $this->hasOne(UserT::className(),['id'=>'user_id']); diff --git a/common/models/LinkmanT.php b/common/models/LinkmanT.php index 44c2d66..9fd4c06 100644 --- a/common/models/LinkmanT.php +++ b/common/models/LinkmanT.php @@ -36,7 +36,7 @@ class LinkmanT extends \common\models\Base [['car_id'], 'integer'], [['created_at', 'updated_at'], 'safe'], [['name'], 'string', 'max' => 100], - [['phone', 'type', 'id_number'], 'string', 'max' => 50], + [['phone', 'type', 'id_type', 'id_number'], 'string', 'max' => 50], ]; } @@ -51,6 +51,7 @@ class LinkmanT extends \common\models\Base 'name' => 'Name', 'phone' => 'Phone', 'type' => 'Type', + 'id_type' => 'Id Type', 'id_number' => 'Id Number', 'created_at' => 'Created At', 'updated_at' => 'Updated At', diff --git a/frontend/controllers/AppointmentController.php b/frontend/controllers/AppointmentController.php index d436bec..08660a8 100644 --- a/frontend/controllers/AppointmentController.php +++ b/frontend/controllers/AppointmentController.php @@ -88,12 +88,43 @@ class AppointmentController extends BaseController return $result; } + public function actionHistoryJson() + { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $car_id = $request->get('car_id'); + $offset = $request->get('offset', 0); + $limit = $request->get('limit', 10); + + $pdate = date("Y-m-d",strtotime("-6 months")); + $query = AppointmentHistoryT::find() + ->where(['car_id'=>$car_id]) + ->andWhere('pdate>"'.$pdate.'"') + ->orderBy('pdate DESC,id DESC'); +//echo $query->createCommand()->rawSql; + $total = $query->count(); + + $query = $query->offset($offset)->limit($limit); + $items = $query->all(); + + $data = []; + $data['total'] = count($items); + $data['rows'] = []; + foreach($items as $item) { + $row = $item->toArray(); + $row['user'] = $item->user?$item->user->getShowName():''; + $data['rows'][] = $row; + } + + return $data; + } + public function actionAdd() { $request = Yii::$app->request; $car_id = $request->get('car_id',0); - return $this->renderPartial('add',[ + return $this->render('add', [ 'car_id' => $car_id ]); } @@ -111,16 +142,15 @@ class AppointmentController extends BaseController $pdate = $request->post('pdate'); $ptime = $request->post('ptime'); $remark = $request->post('remark'); - $ptype = $request->post('ptype'); + $ptype = $request->post('ptype',0); $business_group_id = $request->post('business_group_id', 0); if($pdate == '') { - $result['msg'] = '请选择预约时间!'; + $result['msg'] = '请选择预约日期!'; return $result; } - - if($ptype == '0') { - $result['msg'] = '请选择预约类型!'; + if($ptime == '') { + $result['msg'] = '请选择预约时间!'; return $result; } @@ -175,7 +205,9 @@ class AppointmentController extends BaseController $row->remark = $remark; $row->business_group_id = $business_group_id; $row->is_first = 0; - $row->save(); + if(!$row->save()) { + throw new \Exception(print_r($row->getErrors(), true)); + } $h_row = new AppointmentHistoryT(); $h_row->car_id = $car_id; @@ -185,7 +217,9 @@ class AppointmentController extends BaseController $h_row->ptype = $ptype; $h_row->remark = $remark; $h_row->business_group_id = $business_group_id; - $h_row->save(); + if(!$h_row->save()) { + throw new \Exception(print_r($h_row->getErrors(), true)); + } $log_txt = ''; if($old_user_id > 0) { @@ -195,13 +229,13 @@ class AppointmentController extends BaseController $tran->commit(); + $result['success'] = true; + $result['msg'] = '保存成功'; } catch(\Exception $e) { $tran->rollBack(); - throw $e; + $result['msg'] = $e->getMessage(); } - $result['success'] = true; - $result['msg'] = '保存成功'; } return $result; } diff --git a/frontend/controllers/CarController.php b/frontend/controllers/CarController.php index bd19666..a38e449 100644 --- a/frontend/controllers/CarController.php +++ b/frontend/controllers/CarController.php @@ -89,14 +89,6 @@ class CarController extends BaseController // set_time_limit(0); // $begin_time = time(); // $file_path = \Yii::getAlias('@console').'/controllers/'; - - - - - - - - // var_dump($row); //加上级别筛选 @@ -718,260 +710,10 @@ class CarController extends BaseController } -// public function actionInfo() -// { -// $request = Yii::$app->request; -// $id = $request->get('id',0); -// $type = $request->get('type',0); -// $car_man = $request->get('car_man'); -// $phone = $request->get('phone'); -// $car_no = $request->get('car_no'); -// $page = $request->get('page',1); -// $sort_key = $request->get('sort_key','appointment_t.pdate'); -// $sort_value = $request->get('sort_value','ASC'); -// $next_index = $request->get('next_index',0); -// $back_params = $request->get('back_params'); -// $my_path = $this->my->group?$this->my->group->getPath():''; -// -// $car_info = CarT::findOne(['id'=>$id]); -// $order_info = $car_info->getOrders()->orderBy('id DESC')->one(); -// if(!$order_info) { -// $user_id = 0; -// if($car_info->location == 2) { -// $b_info = CarBT::findOne(['id'=>$car_info->id]); -// $user_id = $b_info->user_id; -// } -// if($car_info->location == 3) { -// $c_info = CarCT::findOne(['id'=>$car_info->id]); -// $user_id = $c_info->user_id; -// } -// if($car_info->location == 4) { -// $d_info = CarDT::findOne(['id'=>$car_info->id]); -// $user_id = $d_info->user_id; -// } -// $order_info = new OrderT(); -// $order_info->car_id = $car_info->id; -// $order_info->car_no = $car_info->car_no; -// $order_info->engine_no = $car_info->engine_no; -// $order_info->car_frame_no = $car_info->car_frame_no; -// $order_info->car_man = $car_info->car_man; -// $order_info->user_id = $user_id; -// $order_info->status_id = 1; -// $order_info->id_man = $car_info->car_man; -// $order_info->link_man = $car_info->car_man; -// $order_info->link_phone = $car_info->phone; -// $order_info->save(); -// } -// $insurer_type_items = InsurerTypeT::find()->all(); -// $insurer_company_items = InsurerCompanyT::find()->all(); -// $insurer_company2_items = InsurerCompany2T::find()->all(); -// $pay_type_items = PayTypeT::find()->all(); -// $car_use_items = CarUseT::find()->all(); -// $car_type_items = CarTypeT::find()->all(); -// $brand_items = BrandT::find()->all(); -// $series_items = SeriesT::find() -// ->where('brand_id='.intval($car_info->brand_id)) -// ->all(); -// $displacement_items = DisplacementT::find() -// ->where('series_id='.intval($car_info->series_id)) -// ->all(); -// $direction_items = DirectionT::find() -// ->all(); -// $range_items = RangeT::find() -// ->all(); -// $city_items = CityT::find() -// ->all(); -// $district_items = DistrictT::find() -// ->orderBy('order_id ASC') -// ->all(); -// $gift_items = GiftT::find() -// ->where('type_id=1') -// ->all(); -// $success_items = InvalidT::getTree(1); -// $failure_items = InvalidT::getTreeXinbaoNew(2); -// -// //下一辆 -// $next_id = 0; -// if($type == 1) { -// $query = AppointmentT::find() -// ->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`') -// ->where('appointment_t.is_first=1 and car_t.is_track=0') -// ->andWhere('appointment_t.pdate<="'.date('Y-m-d').'"'); -// -// $user_ids = $this->getChildrenUserIDs(); -// $query = $query->andWhere(['in','appointment_t.user_id',$user_ids]); -// -// if($car_man != '') { -// $query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); -// } -// if($phone != '') { -// $query = $query->andWhere('car_t.phone="'.$phone.'"'); -// } -// if($car_no != '') { -// $query = $query->andWhere('car_t.car_no like "'.$car_no.'"'); -// } -// if($sort_key != '') { -// $query = $query->orderBy($sort_key.' '.$sort_value); -// } -// $next_item = $query->offset($next_index)->one(); -// if($next_item) { -// $next_id = $next_item->car_id; -// } -// $next_index++; -// } -// if($type == 2) { -// $query = AppointmentT::find() -// ->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`') -// ->where('appointment_t.is_first=0 and car_t.is_track=0') -// ->andWhere('appointment_t.pdate<="'.date('Y-m-d').'"'); -// -// $user_ids = $this->getChildrenUserIDs(); -// $query = $query->andWhere(['in','appointment_t.user_id',$user_ids]); -// -// if($car_man != '') { -// $query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); -// } -// if($phone != '') { -// $query = $query->andWhere('car_t.phone="'.$phone.'"'); -// } -// if($car_no != '') { -// $query = $query->andWhere('car_t.car_no like "'.$car_no.'"'); -// } -// if($sort_key != '') { -// $query = $query->orderBy($sort_key.' '.$sort_value); -// } -// $next_item = $query->offset($next_index)->one(); -// if($next_item) { -// $next_id = $next_item->car_id; -// } -// $next_index++; -// } -// if($type == 3) { -// $query = AppointmentT::find() -// ->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`') -// ->where('appointment_t.is_first=0 and car_t.is_track=0'); -// -// $user_ids = $this->getChildrenUserIDs(); -// $query = $query->andWhere(['in','appointment_t.user_id',$user_ids]); -// -// if($car_man != '') { -// $query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); -// } -// if($phone != '') { -// $query = $query->andWhere('car_t.phone="'.$phone.'"'); -// } -// if($car_no != '') { -// $query = $query->andWhere('car_t.car_no like "'.$car_no.'"'); -// } -// if($sort_key != '') { -// $query = $query->orderBy($sort_key.' '.$sort_value); -// } -// $next_item = $query->offset($next_index)->one(); -// if($next_item) { -// $next_id = $next_item->car_id; -// } -// $next_index++; -// } -// if($type == 4) { -// $query = OrderT::find() -// ->where('status_id=1 and return_status_id>0') -// ->orderBy('submit_date DESC, id DESC'); -// $user_items = $this->my->getChildren(); -// $user_ids[] = $this->my->id; -// if($user_items) { -// foreach($user_items as $user_item) { -// $user_ids[] = $user_item->id; -// } -// } -// $query = $query->andWhere(['in','user_id',$user_ids]); -// if($car_man != '') { -// $query = $query->andWhere('car_man="'.$car_man.'"'); -// } -// if($phone != '') { -// $query = $query->andWhere('link_phone="'.$phone.'"'); -// } -// if($car_no != '') { -// $query = $query->andWhere('car_no="'.$car_no.'"'); -// } -// $next_item = $query->offset($next_index)->one(); -// if($next_item) { -// $next_id = $next_item->car_id; -// } -// $next_index++; -// } -// -//// $gift_type_items = GiftType2T::find()->all(); -// $gift_group_items = GiftGroupT::find() -// ->where('is_free=0') -// ->all(); -// $gift_free_group_items = GiftGroupT::find() -// ->where('is_free=1') -// ->all(); -// //获取礼品数据 -// $sel_gifts = array(); -// $tmp_items = OrderGiftT::find() -// ->where('order_id='.$order_info->id) -// ->all(); -// foreach($tmp_items as $item) { -// $sel_gifts[$item->group_id] = $item; -// } -// -// $list = MeetT::getAllData(1); -// -// $business_group = BusinessGroupT::find()->all(); -// -// return $this->render('info',[ -// 'type' => $type, -// 'car_info' => $car_info, -// 'insurer_type_items' => $insurer_type_items, -// 'order_info' => $order_info, -// 'insurer_company_items' => $insurer_company_items, -// 'insurer_company2_items' => $insurer_company2_items, -// 'list' => $list, -// 'pay_type_items' => $pay_type_items, -// 'car_use_items' => $car_use_items, -// 'car_type_items' => $car_type_items, -// 'brand_items' => $brand_items, -// 'series_items' => $series_items, -// 'displacement_items' => $displacement_items, -// 'direction_items' => $direction_items, -// 'range_items' => $range_items, -// 'city_items' => $city_items, -// 'district_items' => $district_items, -// 'gift_items' => $gift_items, -// 'success_items' => $success_items, -// 'failure_items' => $failure_items, -// 'next_id' => $next_id, -// 'next_index' => $next_index, -// 'car_man' => $car_man, -// 'car_no' => $car_no, -// 'phone' => $phone, -// 'page' => $page, -// 'sort_key' => $sort_key, -// 'sort_value' => $sort_value, -// 'back_params' => $back_params, -//// 'gift_type_items' => $gift_type_items, -// 'gift_group_items' => $gift_group_items, -// 'gift_free_group_items' => $gift_free_group_items, -// 'sel_gifts' => $sel_gifts, -// 'business_group' => $business_group, -// 'business_group_id' => $this->my->business_group_id, -// ]); -// } public function actionInfo() { $request = Yii::$app->request; $id = $request->get('id',0); - $type = $request->get('type',0); - $car_man = $request->get('car_man'); - $phone = $request->get('phone'); - $car_no = $request->get('car_no'); - $page = $request->get('page',1); - $sort_key = $request->get('sort_key','appointment_t.pdate'); - $sort_value = $request->get('sort_value','ASC'); - $next_index = $request->get('next_index',0); - $back_params = $request->get('back_params'); - $my_path = $this->my->group?$this->my->group->getPath():''; $car_info = CarT::findOne(['id'=>$id]); $order_info = $car_info->getOrders()->orderBy('id DESC')->one(); @@ -1030,132 +772,6 @@ class CarController extends BaseController $success_items = InvalidT::getTree(1); $failure_items = InvalidT::getTreeXinbaoNew(2); - //下一辆 - $next_id = 0; - if($type == 1) { - $query = AppointmentT::find() - ->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`') - ->where('appointment_t.is_first=1 and car_t.is_track=0') - ->andWhere('appointment_t.pdate<="'.date('Y-m-d').'"'); - - $user_ids = $this->getChildrenUserIDs(); - $query = $query->andWhere(['in','appointment_t.user_id',$user_ids]); - - if($car_man != '') { - $query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); - } - if($phone != '') { - $query = $query->andWhere('car_t.phone="'.$phone.'"'); - } - if($car_no != '') { - $query = $query->andWhere('car_t.car_no like "'.$car_no.'"'); - } - if($sort_key != '') { - $query = $query->orderBy($sort_key.' '.$sort_value); - } - $next_item = $query->offset($next_index)->one(); - if($next_item) { - $next_id = $next_item->car_id; - } - $next_index++; - } - if($type == 2) { - $query = AppointmentT::find() - ->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`') - ->where('appointment_t.is_first=0 and car_t.is_track=0') - ->andWhere('appointment_t.pdate<="'.date('Y-m-d').'"'); - - $user_ids = $this->getChildrenUserIDs(); - $query = $query->andWhere(['in','appointment_t.user_id',$user_ids]); - - if($car_man != '') { - $query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); - } - if($phone != '') { - $query = $query->andWhere('car_t.phone="'.$phone.'"'); - } - if($car_no != '') { - $query = $query->andWhere('car_t.car_no like "'.$car_no.'"'); - } - if($sort_key != '') { - $query = $query->orderBy($sort_key.' '.$sort_value); - } - $next_item = $query->offset($next_index)->one(); - if($next_item) { - $next_id = $next_item->car_id; - } - $next_index++; - } - if($type == 3) { - $query = AppointmentT::find() - ->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`') - ->where('appointment_t.is_first=0 and car_t.is_track=0'); - - $user_ids = $this->getChildrenUserIDs(); - $query = $query->andWhere(['in','appointment_t.user_id',$user_ids]); - - if($car_man != '') { - $query = $query->andWhere('car_t.car_man like "'.$car_man.'"'); - } - if($phone != '') { - $query = $query->andWhere('car_t.phone="'.$phone.'"'); - } - if($car_no != '') { - $query = $query->andWhere('car_t.car_no like "'.$car_no.'"'); - } - if($sort_key != '') { - $query = $query->orderBy($sort_key.' '.$sort_value); - } - $next_item = $query->offset($next_index)->one(); - if($next_item) { - $next_id = $next_item->car_id; - } - $next_index++; - } - if($type == 4) { - $query = OrderT::find() - ->where('status_id=1 and return_status_id>0') - ->orderBy('submit_date DESC, id DESC'); - $user_items = $this->my->getChildren(); - $user_ids[] = $this->my->id; - if($user_items) { - foreach($user_items as $user_item) { - $user_ids[] = $user_item->id; - } - } - $query = $query->andWhere(['in','user_id',$user_ids]); - if($car_man != '') { - $query = $query->andWhere('car_man="'.$car_man.'"'); - } - if($phone != '') { - $query = $query->andWhere('link_phone="'.$phone.'"'); - } - if($car_no != '') { - $query = $query->andWhere('car_no="'.$car_no.'"'); - } - $next_item = $query->offset($next_index)->one(); - if($next_item) { - $next_id = $next_item->car_id; - } - $next_index++; - } - -// $gift_type_items = GiftType2T::find()->all(); - $gift_group_items = GiftGroupT::find() - ->where('is_free=0') - ->all(); - $gift_free_group_items = GiftGroupT::find() - ->where('is_free=1') - ->all(); - //获取礼品数据 - $sel_gifts = array(); - $tmp_items = OrderGiftT::find() - ->where('order_id='.$order_info->id) - ->all(); - foreach($tmp_items as $item) { - $sel_gifts[$item->group_id] = $item; - } - $list = MeetT::getAllData(1); $business_group = BusinessGroupT::find()->all(); @@ -1163,37 +779,19 @@ class CarController extends BaseController $order_ad=OrderAddress::findOne(['id'=>$order_info->addr_id]); //非车险方案表 -// $scheme_items=Scheme::find()->all(); $province = Region::find()->asArray()->where(['parent_id'=>0])->andWhere(['level'=>1])->all(); -// if($order_ad){ -// $c = Region::find()->asArray()->where(['parent_id'=>$order_ad->province])->andWhere(['level'=>2])->all(); -// $d = Region::find()->asArray()->where(['parent_id'=>$order_ad->city,'level'=>3])->all(); -// $e = Region::find()->asArray()->where(['parent_id'=>$order_ad->district,'level'=>4])->all(); -// -// }else{ -// $c = Region::find()->asArray()->andWhere(['level'=>2])->all(); -// $d = Region::find()->asArray()->where(['level'=>3])->all(); -// $e = Region::find()->asArray()->where(['level'=>4])->all(); -// } $c=[]; $d=[]; $e=[]; -// if($order_ad){ -// $c = Region::find()->asArray()->where(['parent_id'=>$order_ad->province])->andWhere(['level'=>2])->all(); -// $d = Region::find()->asArray()->where(['parent_id'=>$order_ad->city,'level'=>3])->all(); -// $e = Region::find()->asArray()->where(['parent_id'=>$order_ad->district,'level'=>4])->all(); -// -// }else{ -// $c = Region::find()->asArray()->andWhere(['level'=>2])->all(); -// $d = Region::find()->asArray()->where(['level'=>3])->all(); -// $e = Region::find()->asArray()->where(['level'=>4])->all(); -// } + $linkMan_items = $car_info->getLinkmen() + ->orderBy('created_at desc') + ->all(); return $this->render('info',[ - 'type' => $type, 'car_info' => $car_info, + 'link_men' => $linkMan_items, 'insurer_type_items' => $insurer_type_items, 'order_info' => $order_info, 'insurer_company_items' => $insurer_company_items, @@ -1212,21 +810,6 @@ class CarController extends BaseController 'gift_items' => $gift_items, 'success_items' => $success_items, 'failure_items' => $failure_items, - 'next_id' => $next_id, - 'next_index' => $next_index, - 'car_man' => $car_man, - 'car_no' => $car_no, - 'phone' => $phone, - 'page' => $page, - 'sort_key' => $sort_key, - 'sort_value' => $sort_value, - 'back_params' => $back_params, -// 'gift_type_items' => $gift_type_items, - 'gift_group_items' => $gift_group_items, - 'gift_free_group_items' => $gift_free_group_items, - 'sel_gifts' => $sel_gifts, - 'business_group' => $business_group, - 'business_group_id' => $this->my->business_group_id, 'province' => $province, 'city' =>$c, 'district' =>$d, @@ -6160,6 +5743,15 @@ class CarController extends BaseController return $result; } + public function actionLinkmanAdd() + { + $request = Yii::$app->request; + $car_id = $request->get('car_id',0); + return $this->render('linkman-add',[ + 'car_id' => $car_id + ]); + } + public function actionLinkmanSave() { Yii::$app->response->format = Response::FORMAT_JSON; @@ -6173,6 +5765,7 @@ class CarController extends BaseController $name = $request->post('name'); $phone = $request->post('phone'); $id_number = $request->post('id_number'); + $id_type = $request->post('id_type'); $type = $request->post('type'); if($name == '' || $phone == '') { @@ -6186,13 +5779,14 @@ class CarController extends BaseController $linkman_info->name = $name; $linkman_info->phone = $phone; $linkman_info->type = $type; + $linkman_info->id_type = $id_type; $linkman_info->id_number = $id_number; if(!$linkman_info->save()) { - var_dump($linkman_info->errors); + $result['msg'] = print_r($linkman_info->getErrors(),true); + } else { + $result['success'] = true; + $result['msg'] = '保存成功'; } - - $result['success'] = true; - $result['msg'] = '保存成功'; } return $result; } @@ -6220,4 +5814,43 @@ class CarController extends BaseController $result['html'] = $html; return $result; } + + public function actionHistory() { + $request = Yii::$app->request; + $car_id = $request->get('car_id'); + + return $this->render('history',[ + 'car_id' => $car_id + ]); + } + + public function actionHistoryJson() + { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $car_id = $request->get('car_id'); + $offset = $request->get('offset', 0); + $limit = $request->get('limit', 10); + + $query = CarLogT::find() + ->where(['car_id'=>$car_id,'type'=>1]) + ->andWhere('op_time>='.strtotime("-6 months")) + ->orderBy('op_time DESC'); +//echo $query->createCommand()->rawSql; + $total = $query->count(); + + $query = $query->offset($offset)->limit($limit); + $items = $query->all(); + + $data = []; + $data['total'] = count($items); + $data['rows'] = []; + foreach($items as $item) { + $row = $item->toArray(); + $row['op_time'] = date('Y-m-d H:i:s', $item->op_time); + $data['rows'][] = $row; + } + + return $data; + } } diff --git a/frontend/controllers/DatabaseController.php b/frontend/controllers/DatabaseController.php index a3c6e46..09ae8a4 100644 --- a/frontend/controllers/DatabaseController.php +++ b/frontend/controllers/DatabaseController.php @@ -254,7 +254,7 @@ class DatabaseController extends BaseController $row = $item->toArray(); $row['factory_model'] = MyLib::substr_cut($item->factory_model, 8); $row['car_man'] = MyLib::substr_cut($item->car_man, 8); - $row['location'] = $item->getLocation(); + $row['location_name'] = $item->getLocation(); $data['rows'][] = $row; } return $data; diff --git a/frontend/controllers/FinanceController.php b/frontend/controllers/FinanceController.php index a9884af..ab505fe 100644 --- a/frontend/controllers/FinanceController.php +++ b/frontend/controllers/FinanceController.php @@ -6361,7 +6361,7 @@ class FinanceController extends \frontend\controllers\UserBaseController public function actionCarUpdateFrame() { - return $this->render('car-update-frame', []); + return $this->render('car-update-frame'); } public function actionCarUpdateFrameInfo() @@ -6371,24 +6371,11 @@ class FinanceController extends \frontend\controllers\UserBaseController $result = array(); $result['success'] = false; $result['msg'] = '操作失败'; -// $company = $request->post('company', ''); $web_path = Yii::$app->getBasePath() . '/../frontend/web'; $filename = $web_path . $request->post('urlfile'); - $base_filename=$request->post('urlfile'); -// -// $file_path = \Yii::getAlias('@console').'/controllers/'; -// $yearname='wash12.xlsx'; -// $filename = $file_path.$yearname; -// $basename=$yearname; -// $company = $request->post('company', ''); -// -// $web_path = Yii::$app->getBasePath() . '/../frontend/web'; -// -// $urlfile = $web_path . $request->post('urlfile'); -// if(file_exists($filename)) { -// echo 'OK'."\r\n"; -// } + $base_filename=$request->post('file'); + //读取Excel 2007 $PHPReader = new \PHPExcel_Reader_Excel2007(); if (!$PHPReader->canRead($filename)) { @@ -6403,22 +6390,8 @@ class FinanceController extends \frontend\controllers\UserBaseController $currentSheet = $PHPExcel->getSheet(0); $rowCount = $currentSheet->getHighestRow(); - //$data = $currentSheet->toArray('', true, true); //创建新的xlsx表 -// $objectPHPExcel = new \PHPExcel(); -// $index = 1; $insert_total = 0; -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('A'.$index,'车牌号'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$index,'车架号'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('C'.$index,'发动机号'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('D'.$index,'品牌车型'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('E'.$index,'车主'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('F'.$index,'证件号'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('G'.$index,'联系方式'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('H'.$index,'保险到期日'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('I'.$index,'初登日期'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('J'.$index,'标准初登日期'); -// $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('K'.$index,'车牌号不匹配'); for ($i = 2; $i <= $rowCount; $i++) { // echo $i.'/'.$rowCount."..."; @@ -6462,16 +6435,6 @@ class FinanceController extends \frontend\controllers\UserBaseController if ($car_info) { -// -// $car_c_info = CarCT::findOne(['id' => $car_info->id]); -// $car_d_info = CarDT::findOne(['id' => $car_info->id]); -// $car_e_info = CarET::findOne(['id' => $car_info->id]); -// -// if ($car_c_info || $car_d_info || $car_e_info) { -// continue; -// } - - if($car_no != ''){ $car_info->car_no = $car_no; } @@ -6525,7 +6488,7 @@ class FinanceController extends \frontend\controllers\UserBaseController // $car_info->save(); - if(!$car_info->save(false)) { + if(!$car_info->save(false)) { var_dump($car_info->errors); exit; } @@ -6585,7 +6548,7 @@ class FinanceController extends \frontend\controllers\UserBaseController // $car_info->save(); - if(!$car_info->save(false)) { + if(!$car_info->save(false)) { var_dump($car_info->errors); exit; } diff --git a/frontend/views/appointment/add.php b/frontend/views/appointment/add.php index 30a8d50..2debc09 100644 --- a/frontend/views/appointment/add.php +++ b/frontend/views/appointment/add.php @@ -1,42 +1,87 @@ -
+ +beginBlock('header_css'); ?> + +endBlock(); ?> + +操作者 | +操作时间 | +操作内容 | +
---|
-
+
+
+beginBlock('footer_js'); ?>
+
+
+endBlock('footer_js'); ?>
diff --git a/frontend/views/database/a-index.php b/frontend/views/database/a-index.php
index 6dcbb7c..4802729 100644
--- a/frontend/views/database/a-index.php
+++ b/frontend/views/database/a-index.php
@@ -62,7 +62,7 @@ use \common\libs\MyLib;
+
+
+
+
+
+
+
+
+ | 保险公司 | 发动机号 | 车架号 | -位置 | +位置 | 操作 |
---|