diff --git a/frontend/controllers/AppointmentController.php b/frontend/controllers/AppointmentController.php
index 6f0261c..d436bec 100644
--- a/frontend/controllers/AppointmentController.php
+++ b/frontend/controllers/AppointmentController.php
@@ -21,6 +21,9 @@ use yii\web\Response;
class AppointmentController extends BaseController
{
+ public $enableCsrfValidation = false;
+ public $layout = 'blue-main';
+
public function actionIndex()
{
$request = Yii::$app->request;
@@ -237,8 +240,18 @@ class AppointmentController extends BaseController
}
//首拨
- public function actionFirst()
+ public function actionFirst() {
+ $invalid_items = InvalidT::getTree();
+ $user_items = $this->my->getChildren();
+
+ return $this->render('first',[
+ 'invalid_items' => $invalid_items,
+ 'user_items' => $user_items
+ ]);
+ }
+ public function actionFirstJson()
{
+ Yii::$app->response->format = Response::FORMAT_JSON;
$session = Yii::$app->session;
$request = Yii::$app->request;
$car_man = $request->get('car_man');
@@ -249,6 +262,8 @@ class AppointmentController extends BaseController
$sort_key = $request->get('sort_key','appointment_t.pdate');
$sort_value = $request->get('sort_value','ASC');
$user_id = $request->get('user_id');
+ $offset = $request->get('offset',0);
+ $limit = $request->get('limit', 10);
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
@@ -256,17 +271,17 @@ class AppointmentController extends BaseController
if($username == '') {
$user_ids = $this->getChildrenUserIDs();
- $query = $query->andWhere(['in','appointment_t.user_id',$user_ids]);
+ $query->andWhere(['in','appointment_t.user_id',$user_ids]);
}
if($car_man != '') {
- $query = $query->andWhere('car_t.car_man like "'.$car_man.'"');
+ $query->andWhere('car_t.car_man like "'.$car_man.'"');
}
if($phone != '') {
- $query = $query->andWhere('car_t.phone like "'.$phone.'"');
+ $query->andWhere('car_t.phone like "'.$phone.'"');
}
if($car_no != '') {
- $query = $query->andWhere('car_t.car_no like "'.$car_no.'"');
+ $query->andWhere('car_t.car_no like "'.$car_no.'"');
}
if($username != '') {
$user_query = UserT::find()
@@ -276,10 +291,10 @@ class AppointmentController extends BaseController
$user_ids[] = $user_info->id;
}
if(count($user_ids) > 0)
- $query = $query->andWhere(['in','appointment_t.user_id',$user_ids]);
+ $query->andWhere(['in','appointment_t.user_id',$user_ids]);
}
if($sort_key != '') {
- $query = $query->orderBy($sort_key.' '.$sort_value.',appointment_t.id '.$sort_value);
+ $query->orderBy($sort_key.' '.$sort_value.',appointment_t.id '.$sort_value);
}
$sql = $query->createCommand()->rawSql;
// echo $query->createCommand()->rawSql;
@@ -287,33 +302,25 @@ class AppointmentController extends BaseController
$session->remove('appointment_first');
$session->set('appointment_first',$sql);
- $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
- $pagination->setPage($page-1);
-
- $current_index = $pagination->offset;
- $query = $query->offset($pagination->offset)->limit($pagination->limit);
+ $query = $query->offset($offset)->limit($limit);
$items = $query->all();
- $page_info = MyLib::getPageInfo($pagination);
-
- $invalid_items = InvalidT::getTree();
- $user_items = $this->my->getChildren();
-
- return $this->render('first',[
- 'items' => $items,
- 'page_info' => $page_info,
- 'car_man' => $car_man,
- 'phone' => $phone,
- 'car_no' => $car_no,
- 'page' => $page,
- 'sort_key' => $sort_key,
- 'sort_value' => $sort_value,
- 'type' => 1,
- 'invalid_items' => $invalid_items,
- 'username' => $username,
- 'user_items' => $user_items,
- 'user_id' => $user_id
- ]);
+ $data = [];
+ $data['total'] = $total;
+ $data['rows'] = [];
+ foreach($items as $item) {
+ $car_info = $item->car;
+ $row = $item->toArray();
+ $row['car_id'] = $car_info->id;
+ $row['car_no'] = $car_info->car_no;
+ $row['car_man'] = $car_info->car_man;
+ $row['register_date'] = $car_info->register_date;
+ $row['insurer1_date'] = $car_info->insurer1_date;
+ $row['insurer2_date'] = $car_info->insurer2_date;
+ $row['user_name'] = $item->user ? $item->user->getShowName():'';
+ $data['rows'][] = $row;
+ }
+ return $data;
}
//今日预约
diff --git a/frontend/controllers/FixCarController.php b/frontend/controllers/FixCarController.php
index 0198bb4..e60e6a7 100644
--- a/frontend/controllers/FixCarController.php
+++ b/frontend/controllers/FixCarController.php
@@ -22,6 +22,8 @@ use yii\web\Response;
class FixCarController extends BaseController
{
public $my = null;
+ public $enableCsrfValidation = false;
+ public $layout = 'blue-main';
public function init()
{
diff --git a/frontend/controllers/InsurerController.php b/frontend/controllers/InsurerController.php
index dfacf89..fde57f7 100644
--- a/frontend/controllers/InsurerController.php
+++ b/frontend/controllers/InsurerController.php
@@ -59,6 +59,8 @@ use common\models\NonAutoInsurance;
class InsurerController extends BaseController
{
public $my = null;
+ public $enableCsrfValidation = false;
+ public $layout = 'blue-main';
public function init()
{
@@ -406,15 +408,20 @@ class InsurerController extends BaseController
return $result;
}
- public function actionMyList()
+ public function actionMyList() {
+ return $this->render('my-list');
+ }
+
+ public function actionMyListJson()
{
+ Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_man = $request->get('car_man');
$phone = $request->get('phone');
$car_no = $request->get('car_no');
$id_man = $request->get('id_man');
- $page = $request->get('page',1);
- if($page < 1) $page = 1;
+ $offset = $request->get('offset',0);
+ $limit = $request->get('limit', 10);
$query = OrderT::find()
->where('status_id>1')
@@ -427,39 +434,34 @@ class InsurerController extends BaseController
$user_ids[] = $user_item->id;
}
}
- $query = $query->andWhere(['in','user_id',$user_ids]);
+ $query->andWhere(['in','user_id',$user_ids]);
if($car_man != '') {
- $query = $query->andWhere('car_man="'.$car_man.'"');
+ $query->andWhere('car_man="'.$car_man.'"');
}
if($id_man != '') {
- $query = $query->andWhere('id_man="'.$id_man.'"');
+ $query->andWhere('id_man="'.$id_man.'"');
}
if($phone != '') {
- $query = $query->andWhere('link_phone="'.$phone.'"');
+ $query->andWhere('link_phone="'.$phone.'"');
}
if($car_no != '') {
- $query = $query->andWhere('car_no="'.$car_no.'"');
+ $query->andWhere('car_no="'.$car_no.'"');
}
// echo $query->createCommand()->rawSql;
+// exit;
$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();
- $page_info = MyLib::getPageInfo($pagination);
-
- return $this->render('my-list',[
- 'items' => $items,
- 'car_man' => $car_man,
- 'id_man' => $id_man,
- 'phone' => $phone,
- 'car_no' => $car_no,
- 'page' => $page,
- 'page_info' => $page_info
- ]);
+ $data = [];
+ $data['total'] = $total;
+ $data['rows'] = [];
+ foreach($items as $item) {
+ $row = $item->toArray();
+ $data['rows'][] = $row;
+ }
+ return $data;
}
// public function actionMyListInfo()
diff --git a/frontend/controllers/RenewalController.php b/frontend/controllers/RenewalController.php
index 7fff3f2..f5b0008 100644
--- a/frontend/controllers/RenewalController.php
+++ b/frontend/controllers/RenewalController.php
@@ -27,6 +27,8 @@ use yii\web\Response;
class RenewalController extends BaseController
{
public $my = null;
+ public $enableCsrfValidation = false;
+ public $layout = 'blue-main';
public function init()
{
diff --git a/frontend/controllers/StatisticsController.php b/frontend/controllers/StatisticsController.php
index f0ab914..e4cb4f6 100644
--- a/frontend/controllers/StatisticsController.php
+++ b/frontend/controllers/StatisticsController.php
@@ -18,6 +18,9 @@ use yii\web\Response;
class StatisticsController extends BaseController
{
+ public $enableCsrfValidation = false;
+ public $layout = 'blue-main';
+
public function actionWork()
{
$request = Yii::$app->request;
diff --git a/frontend/views/appointment/first.php b/frontend/views/appointment/first.php
index ac7cea8..690f7d3 100644
--- a/frontend/views/appointment/first.php
+++ b/frontend/views/appointment/first.php
@@ -1,161 +1,107 @@
-
-
-
-
+
+
+
-
-
+endBlock(); ?>
diff --git a/frontend/views/insurer/my-list.php b/frontend/views/insurer/my-list.php
index dd3ae44..ea715d2 100644
--- a/frontend/views/insurer/my-list.php
+++ b/frontend/views/insurer/my-list.php
@@ -1,83 +1,105 @@
-
-
-
-
+
+
+
-
-
-
- 序号 |
- 车主 |
- 提单日期 |
- 送单日期 |
- 车牌号 |
- 品牌 |
- 共计签单 |
- 应收 |
- 状态 |
- 业务员 |
- 当前操作 |
- 操作 |
-
- $item) {
- $start_index = ($page - 1) * 20 + $index;
- ?>
-
- =$start_index + 1?> |
- =MyLib::substr_cut($item->car_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():''?> |
- =$item->lock?$item->lock->getShowName():''?> |
-
- insurance_status==1 || $item->insurance_status==3):?>
- [详情]
- insurance_status==2):?>
- [非车险详情]
-
- |
-
-
-
- =$page_info?> |
-
-
+endBlock(); ?>