You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SupplierAction.class.php 1.2 KiB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. //Author:fuhc
  3. //Date:20160908
  4. //供应商
  5. require_once __DIR__.'/../HotelLib.php';
  6. class SupplierAction extends HotelLib{
  7. //得到酒店的供应商列表
  8. function getHotelSupplierList(){
  9. $sql="select DISTINCT b.supplier_id,a.supplier_name from base_supplier a,base_supplier_purchase b where a.id=b.supplier_id and b.product_type = 25 and a.cancel_flag=0 and b.cancel_flag=0
  10. order BY FN_GET_PY_FIRST_LETTER(SUBSTR(a.supplier_name,1,4))";
  11. $data=array();
  12. $rowset=$this->DBTool->queryBySql($sql);
  13. $data['code']=$rowset['code'];
  14. $data['info']=$rowset['info'];
  15. $data['supplier_list']=$rowset['rowset'];
  16. return $data;
  17. }
  18. //根据供应商的到采购人
  19. function getPurchaseNameBySupplier($supplier_id){
  20. $data=ifNullParam(array($supplier_id));
  21. $data['purchase_people_list']=array();
  22. if($data['code']!="0"){
  23. return $data;
  24. }
  25. $sql="select id as purchaser_id,purchaser_name from base_supplier_purchase
  26. where supplier_id={$supplier_id} and product_type=25 and cancel_flag=0";
  27. $data=array();
  28. $rowset=$this->DBTool->queryBySql($sql);
  29. $data['code']=$rowset['code'];
  30. $data['info']=$rowset['info'];
  31. $data['purchase_people_list']=$rowset['rowset'];
  32. return $data;
  33. }
  34. }