|
- <?php
- /**
- * Created by PhpStorm.
- * User: admin
- * Date: 2016/12/22
- * Time: 15:26
- */
-
- namespace backend\modules\hotel\models;
-
-
- use Yii;
- use yii\base\Model;
-
- class HotelModel extends Model
- {
- function getSuppList()
- {
- $sql = "select id,supplier_name from base_supplier where supplier_type = 187 and cancel_flag = 0";
- $connection = Yii::$app->db;
- $data = $connection->createCommand($sql)->queryAll();;
- return $data;
- }
-
- // function getSaleList()
- // {
- // $sql = "select DISTINCT channel_id as id,channel_name as sale_org_name from rep_daily_ht_order";
- // $connection = Yii::$app->db;
- // $data = $connection->createCommand($sql)->queryAll();
- // return $data;
- // }
- function getHotelList()
- {
- $sql = "select hotel_id,hotel_name from opera_hotel where cancel_flag= 0";
- $connection = Yii::$app->db;
- $data = $connection->createCommand($sql)->queryAll();;
- return $data;
- }
-
- function getSaleList()
- {
- // $sql = "select id,supplier_name as sale_org_name from base_supplier where cancel_flag = 0 and supplier_type = 301";
- $sql = "select a.id as id ,a.supplier_name as sale_org_name from base_supplier a inner join base_supplier_sale b on a.id = b.supplier_id where a.cancel_flag = 0 and a.supplier_type = 301 and a.is_disabled = 0 and b.parent_type = 25 and b.cancel_flag=0";
- $connection = Yii::$app->db;
- $data = $connection->createCommand($sql)->queryAll();
- return $data;
- }
-
- //得到省级联动
- function getProvinceCity($parent_id = 0)
- {
- $sql = "select id as area_id,parent_id,area_name,postcode from base_area as A where A.parent_id=$parent_id and A.cancel_flag=0 AND
- A.id<=3222";
- $connection = Yii::$app->db;
- $data = $connection->createCommand($sql)->queryAll();
- return $data;
- }
-
- }
|