diff --git a/frontend/controllers/InsurerController.php b/frontend/controllers/InsurerController.php
index 785f473..16dcdc6 100644
--- a/frontend/controllers/InsurerController.php
+++ b/frontend/controllers/InsurerController.php
@@ -120,66 +120,6 @@ class InsurerController extends BaseController
]);
}
-// public function actionInfo()
-// {
-// $request = Yii::$app->request;
-// $id = $request->get('id',0);
-// $order_info = OrderT::findOne(['id'=>$id]);
-// $car_info = $order_info->car;
-// $nonitems=null;
-// if($order_info->non_id){
-// $nonitems=NonAutoInsurance::findOne(['id'=>$order_info->non_id]);
-// }
-//
-// //快递
-// $ems_items = EmsT::find()
-// ->where(['car_id'=>$car_info->id,'order_id'=>$order_info->id])
-// ->orderBy('id ASC')
-// ->all();
-// //礼品
-// $gift_free_group_items = GiftGroupT::find()
-// ->where('is_free=1')
-// ->all();
-// $gift_group_items = GiftGroupT::find()
-// ->where('is_free=0')
-// ->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;
-// }
-//
-// $insurer_type_items = InsurerTypeT::find()
-// ->all();
-// //登陆用户ID
-// $uid = $this->my->id;
-// $order_caiwu = OrderCaiwuT::findOne(['order_id'=>$order_info->id]);
-// $money_man='';
-// $money_no='';
-// $money_bank='';
-// if($order_caiwu){
-// $money_man=$order_caiwu->money_man;
-// $money_no= $order_caiwu->money_no;
-// $money_bank=$order_caiwu->money_bank;
-// }
-// return $this->render('info',[
-// 'order_info'=>$order_info,
-// 'car_info'=>$car_info,
-// 'ems_items' => $ems_items,
-// 'money_man' => $money_man,
-// 'money_no' => $money_no,
-// 'money_bank' => $money_bank,
-// 'gift_free_group_items' => $gift_free_group_items,
-// 'gift_group_items' => $gift_group_items,
-// 'sel_gifts' => $sel_gifts,
-// 'uid' => $uid,
-// 'insurer_type_items' => $insurer_type_items,
-// 'nonitems' => $nonitems
-// ]);
-// }
public function actionInfo()
{
$request = Yii::$app->request;
@@ -4027,8 +3967,12 @@ class InsurerController extends BaseController
return $this->render('original-ems-edit1',[]);
}
- public function actionSearch()
+ public function actionSearch() {
+ return $this->render('search');
+ }
+ public function actionSearchJson()
{
+ Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_man = $request->get('car_man');
$id_man = $request->get('id_man');
@@ -4044,8 +3988,8 @@ class InsurerController extends BaseController
$group_id = $request->get('group_id');
$company_id = $request->get('company_id');
$insurance_status= $request->get('insurance_status');
-
- if($page < 1) $page = 1;
+ $offset = $request->get('offset',0);
+ $limit = $request->get('limit', 10);
$group_items = GroupT::getTree();
$group_ids[] = $group_id;
@@ -4055,95 +3999,67 @@ class InsurerController extends BaseController
$group_ids[] = $group_info->id;
}
}
-// $submit_date='2018-10-14';
-// $near_info= OrderT::find()->where(['car_no'=>$car_no])
-// ->orderBy('created_at desc')->select('car_man,created_at,user_id')->one();
-// $near_info= OrderT::find()->where(['car_no'=>$car_no])
-// ->asArray()->select('created_at,submit_date,id,car_man')
-// ->andWhere(['status_id'=>10])
-// ->andWhere(['<', 'submit_date', $submit_date])
-// ->orderBy('created_at desc')->one();
-//
-// $car_info->op_user1 = $near_info->user->getShowName();
-// dd($near_info);
$query = OrderT::find()
->where('status_id>1')
-// ->orderBy('submit_date DESC, id DESC');
->orderBy('car_no desc,submit_date asc');
if($id_man != '') {
- $query = $query->andWhere(['like','id_man',$id_man]);
+ $query->andWhere(['like','id_man',$id_man]);
}
if($car_man != '') {
- $query = $query->andWhere(['like','car_man',$car_man]);
+ $query->andWhere(['like','car_man',$car_man]);
}
if($phone != '') {
- $query = $query->andWhere(['like','link_phone',$phone]);
+ $query->andWhere(['like','link_phone',$phone]);
}
if($car_no != '') {
- $query = $query->andWhere(['like','car_no',$car_no]);
+ $query->andWhere(['like','car_no',$car_no]);
}
if($date_begin != '') {
- $query = $query->andWhere('submit_date>="'.$date_begin.'"');
+ $query->andWhere('submit_date>="'.$date_begin.'"');
}
if($date_end != '') {
- $query = $query->andWhere('submit_date<="'.$date_end.'"');
+ $query->andWhere('submit_date<="'.$date_end.'"');
}
if($date2_begin != '') {
- $query = $query->andWhere('print_date>="'.$date2_begin.'"');
+ $query->andWhere('print_date>="'.$date2_begin.'"');
}
if($date2_end != '') {
- $query = $query->andWhere('print_date<="'.$date2_end.'"');
+ $query->andWhere('print_date<="'.$date2_end.'"');
}
if($date3_begin != '') {
- $query = $query->andWhere('insurer1_begin_date>="'.$date3_begin.'"');
+ $query->andWhere('insurer1_begin_date>="'.$date3_begin.'"');
}
if($date3_end != '') {
- $query = $query->andWhere('insurer1_begin_date<="'.$date3_end.'"');
+ $query->andWhere('insurer1_begin_date<="'.$date3_end.'"');
}
if($company_id != '') {
- $query = $query->andWhere('company_id ="'.$company_id.'"');
+ $query->andWhere('company_id ="'.$company_id.'"');
}
if($insurance_status != '') {
- $query = $query->andWhere('insurance_status ="'.$insurance_status.'"');
+ $query->andWhere('insurance_status ="'.$insurance_status.'"');
}
$total = $query->count();
- $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
- $pagination->setPage($page-1);
-
- $query = $query->offset($pagination->offset)->limit($pagination->limit);
+ $query->offset($offset)->limit($limit);
$items = $query->all();
-// echo $query->createCommand()->rawSql;
-
- $sum = $query->sum('total1_clear');
- $sum1 = $query->sum('total2_clear');
-// var_dump($sum1) ;
-
- $page_info = MyLib::getPageInfo($pagination);
- $company_items = InsurerCompanyT::find()->all();
- return $this->render('search',[
- 'items' => $items,
- 'company_items' => $company_items,
- 'insurance_status' => $insurance_status,
- 'company_id' => $company_id,
- 'car_man' => $car_man,
- 'id_man' => $id_man,
- 'phone' => $phone,
- 'car_no' => $car_no,
- 'date_begin' => $date_begin,
- 'date_end' => $date_end,
- 'date2_begin' => $date2_begin,
- 'date2_end' => $date2_end,
- 'date3_begin' => $date3_begin,
- 'date3_end' => $date3_end,
- 'page' => $page,
- 'page_info' => $page_info,
- 'group_items'=>$group_items,
- 'group_id'=>$group_id,
- 'sum' => $sum
- ]);
+ $data = [];
+ $data['total'] = $total;
+ $data['rows'] = [];
+ foreach($items as $item) {
+ $row = $item->toArray();
+ $row['lock_name'] = $item->lock?$item->lock->getShowName():'';
+ $row['status'] = $item->status->name;
+ $row['username'] = $item->user->getShowName();
+ $row['company_name'] = $item->company->name;
+ $row['file_status'] = '未上传';
+ if($item->shangye_src || $item->jiaoqiang_src) {
+ $row['file_status'] = '保单已上传';
+ }
+ $data['rows'][] = $row;
+ }
+ return $data;
}
public function actionSearch1()
{
diff --git a/frontend/views/car/info-track.php b/frontend/views/car/info-track.php
index 24e9d99..780ee24 100644
--- a/frontend/views/car/info-track.php
+++ b/frontend/views/car/info-track.php
@@ -105,7 +105,7 @@ use \common\libs\MyLib;
商业起保日期 |
交强起保日期 |
出单日期 |
- 共计签单 |
+ 共计签单 |
业务员 |
状态 |
操作 |
diff --git a/frontend/views/insurer/info.php b/frontend/views/insurer/info.php
index 28dc74a..972036d 100644
--- a/frontend/views/insurer/info.php
+++ b/frontend/views/insurer/info.php
@@ -1,447 +1,334 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
\ No newline at end of file
+
+endBlock(); ?>
diff --git a/frontend/views/insurer/office-mng-edit.php b/frontend/views/insurer/office-mng-edit.php
index 632b742..d1a63fe 100644
--- a/frontend/views/insurer/office-mng-edit.php
+++ b/frontend/views/insurer/office-mng-edit.php
@@ -75,7 +75,7 @@ use common\models\PriceT;
交强起保日期 |
=$order_info->insurer2_begin_date?> |
保险公司 |
- =$order_info->company2->name?> |
+ =$order_info->company->name?> |
车辆使用性质 |
=$order_info->car->carUse->name?> |
diff --git a/frontend/views/insurer/search.php b/frontend/views/insurer/search.php
index e905c87..0d69d7a 100644
--- a/frontend/views/insurer/search.php
+++ b/frontend/views/insurer/search.php
@@ -1,136 +1,132 @@
-
-
-
-
-
+
+
+
-
-
-
- 序号 |
- 车主 |
- 被保险人 |
- 提单日期 |
- 送单日期 |
- 车牌号 |
- 品牌 |
- 共计签单 |
- 应收 |
- 状态 |
- 业务员 |
- 保险公司 |
- 上传状态 |
- 当前操作 |
- 操作 |
-
- $item) {
- $start_index = ($page - 1) * 20 + $index;
- ?>
-
- =$start_index + 1?> |
- =MyLib::substr_cut($item->car_man,15)?> |
- =MyLib::substr_cut($item->id_man,15)?> |
- =$item->submit_date?> |
- =$item->send_date?> |
- =$item->car_no?> |
- =$item->car?MyLib::substr_cut($item->car->factory_model,15):''?> |
- =$item->total_all?> |
- =$item->total_real?> |
- =$item->status->name?> |
- =$item->user?$item->user->getShowName():''?> |
-
- company):?>
- =$item->company->name?$item->company->name:''?>
-
- |
-
- shangye_src || $item->jiaoqiang_src):?>
- 保单已上传
-
- 未上传
-
- |
- =$item->lock?$item->lock->getShowName():''?> |
-
- insurance_status==1 || $item->insurance_status==3):?>
- [详情]
- insurance_status==2):?>
- [非车险详情]
-
- |
-
-
-
- 净保费总和 |
- =$sum?> |
-
-
- =$page_info?> |
-
-
+endBlock(); ?>