|
- <?php
- //Author:fuhc
- //Date:20160909
- //酒店Action基类 数据层
-
- require_once __DIR__ . '../../BaseHotel.php';
-
- class HotelLib extends BaseHotel
- {
- public $DBTool; //操作数据库工具类
- public $DBLog; //写入日志工具类
-
- function __construct()
- {
- require_once __DIR__ . '/../Common/DB.php';
- require_once __DIR__ . '/../Common/LogTable.php';
- parent::__construct();
- $this->DBTool = DB::getInstance();
- $this->DBLog = LogTable::getInstance();
- }
-
- /**
- * User: wangxj
- *
- * 函数作用
- *
- * @params
- *
- * @return
- */
- function setMemcache($order_id, $type, $prod_top_org_id = '', $prod_name = '', $expire = 0)
- {
-
- $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";
- $hotel = $this->DBTool->queryBySql($sql);
- $prod_top_org_id = $hotel['rowset'][0]['prod_top_org_id'];
- $prod_name = $hotel['rowset'][0]['prod_name'];
- //供应商账户的id
- parent::setMemcache($order_id, $type, $prod_top_org_id, $prod_name);
- }
-
- /**
- * User: wangxj
- *
- * 获取供应商名
- *
- * @order_id string 订单号
- *
- * @result string 供应商名
- */
- function getSupplierName($order_id)
- {
- $supplier_name = '';
- $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";
- $hotel = $this->DBTool->queryBySql($sql);
- if ($hotel['code'] == 0 && $hotel['rowset'][0]['supplier_name'])
- $supplier_name = $hotel['rowset'][0]['supplier_name'];
- return $supplier_name;
- }
-
- }
|