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.
 
 
 
 

62 lines
1.8 KiB

  1. <?php
  2. //Author:fuhc
  3. //Date:20160909
  4. //酒店Action基类 数据层
  5. require_once __DIR__ . '../../BaseHotel.php';
  6. class HotelLib extends BaseHotel
  7. {
  8. public $DBTool; //操作数据库工具类
  9. public $DBLog; //写入日志工具类
  10. function __construct()
  11. {
  12. require_once __DIR__ . '/../Common/DB.php';
  13. require_once __DIR__ . '/../Common/LogTable.php';
  14. parent::__construct();
  15. $this->DBTool = DB::getInstance();
  16. $this->DBLog = LogTable::getInstance();
  17. }
  18. /**
  19. * User: wangxj
  20. *
  21. * 函数作用
  22. *
  23. * @params
  24. *
  25. * @return
  26. */
  27. function setMemcache($order_id, $type, $prod_top_org_id = '', $prod_name = '', $expire = 0)
  28. {
  29. $sql = "select prod_top_org_id , prod_name from order_main where order_id = $order_id and cancel_flag = 0 and parent_order_id = 0 limit 1";
  30. $hotel = $this->DBTool->queryBySql($sql);
  31. $prod_top_org_id = $hotel['rowset'][0]['prod_top_org_id'];
  32. $prod_name = $hotel['rowset'][0]['prod_name'];
  33. //供应商账户的id
  34. parent::setMemcache($order_id, $type, $prod_top_org_id, $prod_name);
  35. }
  36. /**
  37. * User: wangxj
  38. *
  39. * 获取供应商名
  40. *
  41. * @order_id string 订单号
  42. *
  43. * @result string 供应商名
  44. */
  45. function getSupplierName($order_id)
  46. {
  47. $supplier_name = '';
  48. $sql = "select supplier_name from order_main o left join base_supplier s on o.prod_top_org_id = s.id where order_id = $order_id and o.cancel_flag = 0 limit 1";
  49. $hotel = $this->DBTool->queryBySql($sql);
  50. if ($hotel['code'] == 0 && $hotel['rowset'][0]['supplier_name'])
  51. $supplier_name = $hotel['rowset'][0]['supplier_name'];
  52. return $supplier_name;
  53. }
  54. }