Browse Source

数据隔离优化

dev
nizongfeng 3 years ago
parent
commit
7fca47391e
13 changed files with 33 additions and 33 deletions
  1. +3
    -3
      application/admin/controller/CfChannelInfo.php
  2. +3
    -3
      application/admin/controller/CfHotelInfo.php
  3. +5
    -5
      application/admin/controller/CfItem.php
  4. +2
    -2
      application/admin/controller/CfRoomInfo.php
  5. +3
    -3
      application/admin/controller/CfRoomPlan.php
  6. +3
    -3
      application/admin/controller/CfSuplierInfo.php
  7. +1
    -1
      application/admin/controller/Deposit.php
  8. +1
    -1
      application/admin/controller/OrderHotel.php
  9. +1
    -1
      application/admin/controller/OrderItem.php
  10. +4
    -4
      application/admin/controller/OrderMain.php
  11. +3
    -3
      application/admin/controller/PaymentOrder.php
  12. +3
    -3
      application/admin/controller/ReceiptOrder.php
  13. +1
    -1
      application/admin/controller/auth/Admin.php

+ 3
- 3
application/admin/controller/CfChannelInfo.php View File

@@ -64,7 +64,7 @@ class CfChannelInfo extends Backend
}
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$result = $this->model->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
@@ -101,7 +101,7 @@ class CfChannelInfo extends Backend
return $this->selectpage();
}
$groupDao = new GroupDao();
$group_id = $groupDao->getTopGroup($this->auth->getGroupId());
$group_id = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->where($where)
@@ -122,7 +122,7 @@ class CfChannelInfo extends Backend
$keyValue=$this->request->post('keyValue');
$this->model->field('id,channel_name as name,commission_rate');
$groupDao = new GroupDao();
$group_id = $groupDao->getTopGroup($this->auth->getGroupId());
$group_id = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$where = ["group_id"=>$group_id];
if($keyValue){
$where = ['id'=>$keyValue,"group_id"=>$group_id];


+ 3
- 3
application/admin/controller/CfHotelInfo.php View File

@@ -48,7 +48,7 @@ class CfHotelInfo extends Backend
$keyValue=$this->request->post('keyValue');
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$result= $this->model->getList($name,$keyValue,$params);
if($keyValue){
return json(['list' => $result]);
@@ -65,7 +65,7 @@ class CfHotelInfo extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new CfHotelInfoService();
return json($service->getList($params));
}
@@ -78,7 +78,7 @@ class CfHotelInfo extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new CfHotelInfoService();
return json($service->save($params));
}


+ 5
- 5
application/admin/controller/CfItem.php View File

@@ -54,7 +54,7 @@ class CfItem extends Backend
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$group_id=$this->auth->getGroupId();
$group_id=$this->auth->getGroupIds()[0];
$list = $this->model
->alias("a")
->join('hbp_admin c','a.create_id = c.id','left')
@@ -117,7 +117,7 @@ class CfItem extends Backend
$params["city_name"]=$area->where("id","=",$params["city"])->value("name");
}
$params['create_id']=$this->auth->id;
$params['group_id']=$this->auth->getGroupId();
$params['group_id']=$this->auth->getGroupIds()[0];
$result = $this->model->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
@@ -210,7 +210,7 @@ class CfItem extends Backend
$keyValue=$this->request->post('keyValue');
$this->model->field('id,item_name as name,item_unit,item_type,item_memo,purchase_user_id');
$groupDao = new GroupDao();
$group_id = $groupDao->getTopGroup($this->auth->getGroupId());
$group_id = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$where = ["del_flag"=>0,"group_id"=>$group_id];
if($keyValue){
$where = ['id'=>$keyValue,"del_flag"=>0,"group_id"=>$group_id];
@@ -244,7 +244,7 @@ class CfItem extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new CfItemService();
return json($service->getList($params));
}
@@ -257,7 +257,7 @@ class CfItem extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new CfItemService();
return json($service->save($params));
}


+ 2
- 2
application/admin/controller/CfRoomInfo.php View File

@@ -54,7 +54,7 @@ class CfRoomInfo extends Backend
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$group_id=$this->auth->getGroupId();
$group_id=$this->auth->getGroupIds()[0];
$groupDao = new GroupDao();
$group_id = $groupDao->getTopGroup($group_id);
$list = $this->model
@@ -100,7 +100,7 @@ class CfRoomInfo extends Backend
}
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$result = $this->model->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {


+ 3
- 3
application/admin/controller/CfRoomPlan.php View File

@@ -52,7 +52,7 @@ class CfRoomPlan extends Backend

public function getList(){
$groupDao = new GroupDao();
$group_id = $groupDao->getTopGroup($this->auth->getGroupId());
$group_id = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$name=$this->request->post('name');
$keyValue=$this->request->post('keyValue');
$this->model->field('id,plan_name as name,purchase_user_id,plan_memo');
@@ -81,7 +81,7 @@ class CfRoomPlan extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new CfRoomPlanDao();
return json($service->getList($params));
}
@@ -94,7 +94,7 @@ class CfRoomPlan extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new CfRoomPlanDao();
return json($service->save($params));
}


+ 3
- 3
application/admin/controller/CfSuplierInfo.php View File

@@ -70,7 +70,7 @@ class CfSuplierInfo extends Backend
}
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$result = $this->model->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
@@ -107,7 +107,7 @@ class CfSuplierInfo extends Backend
return $this->selectpage();
}
$groupDao = new GroupDao();
$group_id = $groupDao->getTopGroup($this->auth->getGroupId());
$group_id = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->where($where)
@@ -127,7 +127,7 @@ class CfSuplierInfo extends Backend
$keyValue=$this->request->post('keyValue');
$this->model->field('id,supplier_name as name');
$groupDao = new GroupDao();
$group_id = $groupDao->getTopGroup($this->auth->getGroupId());
$group_id = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$where = ["group_id"=>$group_id];
if($keyValue){
$where = ['id'=>$keyValue,"group_id"=>$group_id];


+ 1
- 1
application/admin/controller/Deposit.php View File

@@ -49,7 +49,7 @@ class Deposit extends Backend
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$group_id=$this->auth->getGroupId();
$group_id=$this->auth->getGroupIds()[0];
$list = $this->model
->alias("a")
->join('hbp_admin c','a.create_id = c.id','left')


+ 1
- 1
application/admin/controller/OrderHotel.php View File

@@ -70,7 +70,7 @@ class OrderHotel extends Backend
return $this->selectpage();
}
$groupDao = new GroupDao();
$group_id = $groupDao->getTopGroup($this->auth->getGroupId());
$group_id = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->where($where)


+ 1
- 1
application/admin/controller/OrderItem.php View File

@@ -70,7 +70,7 @@ class OrderItem extends Backend
return $this->selectpage();
}
$groupDao = new GroupDao();
$group_id = $groupDao->getTopGroup($this->auth->getGroupId());
$group_id = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->where($where)


+ 4
- 4
application/admin/controller/OrderMain.php View File

@@ -52,7 +52,7 @@ class OrderMain extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$orderMainService = new OrderMainService();
Db::startTrans();
$result = $orderMainService->saveOrder($params);
@@ -72,7 +72,7 @@ class OrderMain extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$orderMainService = new OrderMainService();
Db::startTrans();
$result = $orderMainService->subOrderSave($params);
@@ -116,7 +116,7 @@ class OrderMain extends Backend
private function insertOrderMain($params){
$orderMain = new \app\admin\model\OrderMain();
$params['create_id']=$this->auth->id;
$params['group_id']=$this->auth->getGroupId();
$params['group_id']=$this->auth->getGroupIds()[0];
$result = $orderMain->allowField(true)->save($params);
}

@@ -127,7 +127,7 @@ class OrderMain extends Backend
public function getOrderList(){
$params=$this->request->post();
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$orderMainService = new OrderMainService();
$result = $orderMainService->getOrderList($params);
return json($result);


+ 3
- 3
application/admin/controller/PaymentOrder.php View File

@@ -46,7 +46,7 @@ class PaymentOrder extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new PaymentOrderService();
$result = $service->save($params);
return json($result);
@@ -59,7 +59,7 @@ class PaymentOrder extends Backend
public function getList(){
$params=$this->request->post();
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new PaymentOrderService();
$result = $service->getList($params);
return json($result);
@@ -106,7 +106,7 @@ class PaymentOrder extends Backend
public function getSubOrderList(){
$params=$this->request->post();
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new PaymentOrderService();
$result = $service->getSubOrderList($params);
return json($result);


+ 3
- 3
application/admin/controller/ReceiptOrder.php View File

@@ -50,7 +50,7 @@ class ReceiptOrder extends Backend
$params=$this->request->post();
$params['create_id']=$this->auth->id;
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new ReceiptOrderService();
$result = $service->save($params);
return json($result);
@@ -63,7 +63,7 @@ class ReceiptOrder extends Backend
public function getList(){
$params=$this->request->post();
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new ReceiptOrderService();
$result = $service->getList($params);
return json($result);
@@ -110,7 +110,7 @@ class ReceiptOrder extends Backend
public function getOrderMainList(){
$params=$this->request->post();
$groupDao = new GroupDao();
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupId());
$params['group_id'] = $groupDao->getTopGroup($this->auth->getGroupIds()[0]);
$service = new ReceiptOrderService();
$result = $service->getOrderMainList($params);
return json($result);


+ 1
- 1
application/admin/controller/auth/Admin.php View File

@@ -302,7 +302,7 @@ class Admin extends Backend
$keyValue=$this->request->post('keyValue');
$this->model->field('id,nickname as name');
$groupDao = new GroupDao();
$groupIds = $groupDao->getSubGroup($this->auth->getGroupId());
$groupIds = $groupDao->getSubGroup($groupDao->getTopGroup($this->auth->getGroupIds()[0]));
//获取用户ID
$accModel = new AuthGroupAccess();
$accList = $accModel->where(["group_id" => ["in",$groupIds]])->select();


Loading…
Cancel
Save