PackagesKd.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <?php
  2. namespace App\DataApiNew\Models;
  3. use Illuminate\Database\Eloquent\SoftDeletes;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Dcat\Admin\Traits\HasDateTimeFormatter;
  6. // 宽带套餐
  7. class PackagesKd extends Model
  8. {
  9. use SoftDeletes, HasDateTimeFormatter;
  10. protected $table = 'packages_kd';
  11. protected $dateFormat = 'Y-m-d H:i:s';
  12. // 表字段
  13. protected $fillable = [
  14. 'id',
  15. 'name', // 名称
  16. 'price',
  17. 'mini_text', // 简介
  18. 'image', // 主图
  19. 'details', // 详情
  20. 'operator_id', // 运营商
  21. 'yj',
  22. 'yjzc', // 佣金政策
  23. 'type_id', // 套餐类型
  24. 'monthly_rent', // 月租
  25. 'weight', // 权重
  26. 'upstream_code', // 上游套餐编码
  27. 'production_type_id', // 生产方式
  28. 'is_upload', // 是否上架
  29. 'need_idcard', // 是否需要身份证号
  30. 'is_upload_idcard', // 是否需要上传身份证照片
  31. 'status', // 状态
  32. 'created_at',
  33. 'updated_at',
  34. 'out_package_id', // 外部产品编码
  35. 'belonging_place', // 归属地
  36. 'data_quota', // 流量额度
  37. 'call_duration', // 通话时长
  38. 'is_choose_number', // 是否可选号
  39. 'first_recharge_amount', // 首充金额
  40. 'direct_send_status', // 直接提交局方,0表示不提,1表示提
  41. 'uporlocal', // 线上或本地号库切换,默认为0:无号库,1:本地号库,2:线上号库
  42. 'color', // 颜色
  43. 'min_age', // 最小年龄
  44. 'max_age', // 最大年龄
  45. 'family_number', // 亲情号
  46. 'beautiful_number', // 靓号
  47. 'ownership_change', // 可否自选归属地
  48. 'discount_month', // 优惠有效期,单位月
  49. 'month_rent', // 套餐月租
  50. 'general_traffic', // 通用流量
  51. 'directional_traffic', // 定向流量
  52. 'long_short_tariff', // 长期资费/短期资费
  53. 'interest', // 附带权益
  54. 'original_month_rent', // 原月租
  55. 'sensitive_areas',
  56. 'cover_img', // 封面图
  57. 'attention', // 注意事项
  58. 'noly_delivery_area', // 只发货地区
  59. 'bright', // 亮点
  60. 'rebate_type', // 返佣类型 1:次月返 2:秒返
  61. 'knowledge_base', // 知识库
  62. 'select_status', // 是否选号
  63. 'is_valid', // 是否校验
  64. 'valid_req_code', // 前置校验编码
  65. 'tag_ids', // 套餐标签
  66. 'shop_tag_ids', // 小店套餐标签
  67. 'data_orientation', // 定向流量
  68. 'data_usual', // 通用流量
  69. 'is_live', // 是否允许直播 0:不允许 1:允许
  70. 'deleted_at', // 删除时间
  71. 'yj_api',
  72. 'ident_image', // 运营商标识图
  73. 'delist_time', // 下架时间
  74. 'product_type', // 产品类型 0号卡 1宽带
  75. 'internet_speed', // 网速
  76. 'supplier_id', // 供货商id
  77. 'commission_terms', // 结佣条件
  78. 'package_key',// 套餐秘钥
  79. ];
  80. // 查询字段
  81. public static $selectFields = [
  82. 'id',
  83. 'name', // 名称
  84. 'price',
  85. 'mini_text', // 简介
  86. 'image', // 主图
  87. 'details', // 详情
  88. 'operator_id', // 运营商
  89. 'yj',
  90. 'yjzc', // 佣金政策
  91. 'type_id', // 套餐类型
  92. 'monthly_rent', // 月租
  93. 'weight', // 权重
  94. // 'upstream_code', // 上游套餐编码
  95. // 'production_type_id', // 生产方式
  96. 'is_upload', // 是否上架
  97. 'need_idcard', // 是否需要身份证号
  98. 'is_upload_idcard', // 是否需要上传身份证照片
  99. // 'status', // 状态
  100. 'created_at',
  101. 'updated_at',
  102. 'out_package_id', // 外部产品编码
  103. 'belonging_place', // 归属地
  104. 'data_quota', // 流量额度
  105. 'call_duration', // 通话时长
  106. 'is_choose_number', // 是否可选号
  107. 'first_recharge_amount', // 首充金额
  108. 'direct_send_status', // 直接提交局方,0表示不提,1表示提
  109. 'uporlocal', // 线上或本地号库切换,默认为0:无号库,1:本地号库,2:线上号库
  110. 'color', // 颜色
  111. 'min_age', // 最小年龄
  112. 'max_age', // 最大年龄
  113. 'family_number', // 亲情号
  114. 'beautiful_number', // 靓号
  115. 'ownership_change', // 可否自选归属地
  116. 'discount_month', // 优惠有效期,单位月
  117. 'month_rent', // 套餐月租
  118. 'general_traffic', // 通用流量
  119. 'directional_traffic', // 定向流量
  120. 'long_short_tariff', // 长期资费/短期资费
  121. 'interest', // 附带权益
  122. 'original_month_rent', // 原月租
  123. 'sensitive_areas',
  124. 'cover_img', // 封面图
  125. 'attention', // 注意事项
  126. 'noly_delivery_area', // 只发货地区
  127. 'bright', // 亮点
  128. 'rebate_type', // 返佣类型 1:次月返 2:秒返
  129. // 'knowledge_base', // 知识库
  130. 'select_status', // 是否选号
  131. 'is_valid', // 是否校验
  132. 'valid_req_code', // 前置校验编码
  133. 'tag_ids', // 套餐标签
  134. 'shop_tag_ids', // 小店套餐标签
  135. 'data_orientation', // 定向流量
  136. 'data_usual', // 通用流量
  137. 'is_live', // 是否允许直播 0:不允许 1:允许
  138. 'deleted_at', // 删除时间
  139. // 'yj_api',
  140. 'ident_image', // 运营商标识图
  141. 'delist_time', // 下架时间
  142. 'product_type', // 产品类型 0号卡 1宽带
  143. 'internet_speed', // 网速
  144. 'supplier_id', // 供货商id
  145. 'commission_terms', // 结佣条件
  146. 'package_key',// 套餐秘钥
  147. ];
  148. // 小店套餐查询字段
  149. public static $selectFieldsByShop = [
  150. 'id',
  151. 'name', // 名称
  152. 'price',
  153. 'mini_text', // 简介
  154. 'image', // 主图
  155. 'details', // 详情
  156. 'operator_id', // 运营商
  157. 'yjzc', // 佣金政策
  158. 'type_id', // 套餐类型
  159. 'monthly_rent', // 月租
  160. 'weight', // 权重
  161. 'is_upload', // 是否上架
  162. 'need_idcard', // 是否需要身份证号
  163. 'is_upload_idcard', // 是否需要上传身份证照片
  164. 'created_at',
  165. 'belonging_place', // 归属地
  166. 'data_quota', // 流量额度
  167. 'call_duration', // 通话时长
  168. 'is_choose_number', // 是否可选号
  169. 'first_recharge_amount', // 首充金额
  170. 'min_age', // 最小年龄
  171. 'max_age', // 最大年龄
  172. 'discount_month', // 优惠有效期,单位月
  173. 'month_rent', // 套餐月租
  174. 'general_traffic', // 通用流量
  175. 'directional_traffic', // 定向流量
  176. 'long_short_tariff', // 长期资费/短期资费
  177. 'interest', // 附带权益
  178. 'original_month_rent', // 原月租
  179. 'cover_img', // 封面图
  180. 'attention', // 注意事项
  181. 'noly_delivery_area', // 只发货地区
  182. 'bright', // 亮点
  183. 'rebate_type', // 返佣类型 1:次月返 2:秒返
  184. // 'knowledge_base', // 知识库
  185. 'select_status', // 是否选号
  186. 'is_valid', // 是否校验
  187. 'valid_req_code', // 前置校验编码
  188. 'tag_ids', // 套餐标签
  189. 'shop_tag_ids', // 小店套餐标签
  190. 'data_orientation', // 定向流量
  191. 'data_usual', // 通用流量
  192. 'ident_image', // 运营商标识图
  193. 'delist_time', // 下架时间
  194. 'internet_speed', // 网速
  195. 'commission_terms', // 结佣条件
  196. 'package_key',// 套餐秘钥
  197. ];
  198. // 是否允许直播
  199. const IS_LIVE_ALLOW = 1;
  200. const IS_LIVE_NOT_ALLOW = 0;
  201. public static $isLive = [
  202. self::IS_LIVE_ALLOW => '允许',
  203. self::IS_LIVE_NOT_ALLOW => '不允许',
  204. ];
  205. // 是否上架
  206. const IS_UPLOAD_YES = 1;
  207. const IS_UPLOAD_NO = 0;
  208. public static $isUpload = [
  209. self::IS_UPLOAD_YES => '上架',
  210. self::IS_UPLOAD_NO => '下架',
  211. ];
  212. // 返佣类型
  213. const REBATE_TYPE_MONTH = 1;
  214. const REBATE_TYPE_SECOND = 2;
  215. public static $rebateType = [
  216. self::REBATE_TYPE_MONTH => '次月返',
  217. self::REBATE_TYPE_SECOND => '秒返',
  218. ];
  219. // 是否选号
  220. const SELECT_STATUS_YES = 1;
  221. const SELECT_STATUS_NO = 0;
  222. public static $selectStatus = [
  223. self::SELECT_STATUS_YES => '是',
  224. self::SELECT_STATUS_NO => '否',
  225. ];
  226. public function suppliers()
  227. {
  228. return $this->belongsTo(Suppliers::class, 'supplier_id', 'id')->select(['id', 'name']);
  229. }
  230. }