diff --git a/application/admin/controller/CfHotelInfo.php b/application/admin/controller/CfHotelInfo.php index 37f7e58..2a882d0 100755 --- a/application/admin/controller/CfHotelInfo.php +++ b/application/admin/controller/CfHotelInfo.php @@ -83,7 +83,7 @@ class CfHotelInfo extends Backend if($keyValue){ return json(['list' => $result]); } - return json(['list' => array_merge([['id'=>0,'name'=>'暂无']],$result)]); + return json(['list' => $result]); } /** diff --git a/application/admin/controller/CfItem.php b/application/admin/controller/CfItem.php index 3f9f8ee..378b33a 100755 --- a/application/admin/controller/CfItem.php +++ b/application/admin/controller/CfItem.php @@ -56,7 +56,8 @@ class CfItem extends Backend $list = $this->model ->alias("a") ->join('hbp_admin c','a.create_id = c.id','left') - ->field("a.*,c.nickname") + ->join('hbp_admin d','a.purchase_user_id = d.id','left') + ->field("a.*,c.nickname,d.nickname as purchase_user_name") ->where($where); if ($group_id){ $list = $list @@ -71,9 +72,12 @@ class CfItem extends Backend $config = \think\Config::get("site.item_category"); $config = json_decode($config,true); + $config1 = \think\Config::get("site.item_unit"); + $config1 = json_decode($config1,true); $res = $list->items(); foreach ($res as $key=>$val){ $res[$key]["item_type_name"]=$config[$val["item_type"]]; + $res[$key]["item_unit"]=$config1[$val["item_unit"]]; } $result = array("total" => $list->total(), "rows" => $list->items()); return json($result); @@ -221,6 +225,11 @@ class CfItem extends Backend foreach ($result as $key=>$value){ $result[$key]["item_type_name"]= $config[$value["item_type"]]; } + $config = \think\Config::get("site.item_unit"); + $config = json_decode($config,true); + foreach ($result as $key=>$value){ + $result[$key]["item_unit"]= $config[$value["item_unit"]]; + } if($keyValue){ return json(['list' => $result]); } diff --git a/application/admin/controller/CfRoomPlan.php b/application/admin/controller/CfRoomPlan.php index 5329798..410db22 100755 --- a/application/admin/controller/CfRoomPlan.php +++ b/application/admin/controller/CfRoomPlan.php @@ -51,7 +51,7 @@ class CfRoomPlan extends Backend public function getList(){ $name=$this->request->post('name'); $keyValue=$this->request->post('keyValue'); - $this->model->field('id,plan_name as name'); + $this->model->field('id,plan_name as name,purchase_user_id'); if($keyValue){ $this->model->where(['id'=>$keyValue]); }elseif($name){ @@ -81,10 +81,10 @@ class CfRoomPlan extends Backend $list = $this->model ->alias("a") ->join('hbp_admin c','a.create_id = c.id','left') - ->join('hbp_admin d','a.charge_person = d.id','left') + ->join('hbp_admin d','a.purchase_user_id = d.id','left') ->join('hbp_cf_room_info e','a.room_id = e.id','left') ->join('hbp_cf_hotel_info f','a.hotel_id = f.id','left') - ->field("a.*,c.nickname,d.nickname as charge_person_name,e.room_name,f.hotel_name") + ->field("a.*,c.nickname,d.nickname as purchase_user_name,e.room_name,f.hotel_name") ->where($where); if ($group_id){ $list = $list diff --git a/application/admin/view/cf_item/add.html b/application/admin/view/cf_item/add.html index a0149d1..21d40b9 100755 --- a/application/admin/view/cf_item/add.html +++ b/application/admin/view/cf_item/add.html @@ -21,7 +21,7 @@
- +
@@ -44,7 +44,12 @@
- +
+ +
+ +
+