login_user_id; if(empty($user_id) || empty($stock_type) || empty($base_price) || empty($total_count) || empty($run_date) || empty($room_type) || empty($hotel_id)){ $data['code']="16"; $data['info']="错误的请求参数"; return $data; } $Model=array( "user_id"=>$user_id, "stock_type"=>$stock_type, "base_price"=>$base_price, "total_count"=>$total_count, "run_date"=>$run_date, "room_type"=>$room_type, "hotel_id"=>$hotel_id ); $baseRoom=new HTBaseRoom; $data=$baseRoom->updateBaseRoom($Model); return $data; } // 修改采购价及库存 function updateStockPrice(){ $user_id = $this->login_user_id; $hotel_id=isset($_POST['hotel_id'])?$_POST['hotel_id']:(isset($_GET['hotel_id'])?$_GET['hotel_id']:""); // 不为空 $room_info=isset($_POST['room_info'])?$_POST['room_info']:(isset($_GET['room_info'])?$_GET['room_info']:""); // 不为空 if(empty($hotel_id) || empty($room_info)){ $data['code']="16"; $data['info']="错误的请求参数"; return $data; } $baseRoom=new HTBaseRoom; $data=$baseRoom->updateStockPrice($user_id,$hotel_id,$room_info); return $data; } } $op=isset($_POST['op'])?$_POST['op']:(isset($_GET['op'])?$_GET['op']:""); // 不为空 $data=array(); $data['code']="0"; $data['info']=""; if($op==""){ $data['code']="5"; $data['info']="op操作参数异常"; echo json_encode($data); exit(); } $update = new UpdateBaseRm(); if($op=="upbase"){ $data=$update->updateBaseRoom(); }else if($op=="upstockprice"){ $data=$update->updateStockPrice(); } echo json_encode($data);