@@ -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]; | |||
@@ -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)); | |||
} | |||
@@ -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)); | |||
} | |||
@@ -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) { | |||
@@ -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)); | |||
} | |||
@@ -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]; | |||
@@ -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') | |||
@@ -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) | |||
@@ -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) | |||
@@ -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); | |||
@@ -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); | |||
@@ -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); | |||
@@ -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(); | |||