|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- //Author:fuhc
- //Date:20161010
- //供应商
-
-
- require_once "Api/ApiBase.php";
- require_once "Lib/Common/SupplierAction.class.php";
-
-
- class Supplier extends ApiBase{
-
-
-
- function getHotelSupplierList(){
- $supplierobj = new SupplierAction;
- $supplierList=$supplierobj->getHotelSupplierList();
- $data['code']=$supplierList['code'];
- $data['info']=$supplierList['info'];
- $data['supplier_list']=$supplierList['supplier_list'];
- return $data;
-
- }
- function getPurchaseNameBySupplier(){
- $supplier_id=isset($_POST['supplier_id'])?$_POST['supplier_id']:(isset($_GET['supplier_id'])?$_GET['supplier_id']:""); // 不为空
- if(empty($supplier_id) && $supplier_id!="0"){
- $data['code']="16";
- $data['info']="错误的请求参数";
- return $data;
- }
- $supplierobj = new SupplierAction;
- $purchaseNames=$supplierobj->getPurchaseNameBySupplier($supplier_id);
- $data['code']=$purchaseNames['code'];
- $data['info']=$purchaseNames['info'];
- if($data['code']!="0"){
- return $data;
- }
- $data['purchase_people_list']=$purchaseNames['purchase_people_list'];
- return $data;
- }
- }
- $op=isset($_POST['op'])?$_POST['op']:(isset($_GET['op'])?$_GET['op']:""); // 不为空
- $data=array();
- $data['code']="0";
- $data['info']="";
- if(empty($op)){
- $data['code']="5";
- $data['info']="op操作参数异常";
- echo json_encode($data);
- exit();
- }
- $obj=new Supplier;
- if($op=="selsupplier"){
- $data=$obj->getHotelSupplierList();
- }else if($op=="selpurchase"){
- $data=$obj->getPurchaseNameBySupplier();
- }
- echo json_encode($data);
-
|