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.
 
 
 
 
 
 

59 lines
1.9 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: admin
  5. * Date: 2016/12/22
  6. * Time: 15:26
  7. */
  8. namespace backend\modules\hotel\models;
  9. use Yii;
  10. use yii\base\Model;
  11. class HotelModel extends Model
  12. {
  13. function getSuppList()
  14. {
  15. $sql = "select id,supplier_name from base_supplier where supplier_type = 187 and cancel_flag = 0";
  16. $connection = Yii::$app->db;
  17. $data = $connection->createCommand($sql)->queryAll();;
  18. return $data;
  19. }
  20. // function getSaleList()
  21. // {
  22. // $sql = "select DISTINCT channel_id as id,channel_name as sale_org_name from rep_daily_ht_order";
  23. // $connection = Yii::$app->db;
  24. // $data = $connection->createCommand($sql)->queryAll();
  25. // return $data;
  26. // }
  27. function getHotelList()
  28. {
  29. $sql = "select hotel_id,hotel_name from opera_hotel where cancel_flag= 0";
  30. $connection = Yii::$app->db;
  31. $data = $connection->createCommand($sql)->queryAll();;
  32. return $data;
  33. }
  34. function getSaleList()
  35. {
  36. // $sql = "select id,supplier_name as sale_org_name from base_supplier where cancel_flag = 0 and supplier_type = 301";
  37. $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";
  38. $connection = Yii::$app->db;
  39. $data = $connection->createCommand($sql)->queryAll();
  40. return $data;
  41. }
  42. //得到省级联动
  43. function getProvinceCity($parent_id = 0)
  44. {
  45. $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
  46. A.id<=3222";
  47. $connection = Yii::$app->db;
  48. $data = $connection->createCommand($sql)->queryAll();
  49. return $data;
  50. }
  51. }