123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- <?php
- namespace App\DataApiNew\Models;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use Illuminate\Database\Eloquent\Model;
- use Dcat\Admin\Traits\HasDateTimeFormatter;
- // 宽带套餐
- class PackagesKd extends Model
- {
- use SoftDeletes, HasDateTimeFormatter;
- protected $table = 'packages_kd';
- protected $dateFormat = 'Y-m-d H:i:s';
-
- // 表字段
- protected $fillable = [
- 'id',
- 'name', // 名称
- 'price',
- 'mini_text', // 简介
- 'image', // 主图
- 'details', // 详情
- 'operator_id', // 运营商
- 'yj',
- 'yjzc', // 佣金政策
- 'type_id', // 套餐类型
- 'monthly_rent', // 月租
- 'weight', // 权重
- 'upstream_code', // 上游套餐编码
- 'production_type_id', // 生产方式
- 'is_upload', // 是否上架
- 'need_idcard', // 是否需要身份证号
- 'is_upload_idcard', // 是否需要上传身份证照片
- 'status', // 状态
- 'created_at',
- 'updated_at',
- 'out_package_id', // 外部产品编码
- 'belonging_place', // 归属地
- 'data_quota', // 流量额度
- 'call_duration', // 通话时长
- 'is_choose_number', // 是否可选号
- 'first_recharge_amount', // 首充金额
- 'direct_send_status', // 直接提交局方,0表示不提,1表示提
- 'uporlocal', // 线上或本地号库切换,默认为0:无号库,1:本地号库,2:线上号库
- 'color', // 颜色
- 'min_age', // 最小年龄
- 'max_age', // 最大年龄
- 'family_number', // 亲情号
- 'beautiful_number', // 靓号
- 'ownership_change', // 可否自选归属地
- 'discount_month', // 优惠有效期,单位月
- 'month_rent', // 套餐月租
- 'general_traffic', // 通用流量
- 'directional_traffic', // 定向流量
- 'long_short_tariff', // 长期资费/短期资费
- 'interest', // 附带权益
- 'original_month_rent', // 原月租
- 'sensitive_areas',
- 'cover_img', // 封面图
- 'attention', // 注意事项
- 'noly_delivery_area', // 只发货地区
- 'bright', // 亮点
- 'rebate_type', // 返佣类型 1:次月返 2:秒返
- 'knowledge_base', // 知识库
- 'select_status', // 是否选号
- 'is_valid', // 是否校验
- 'valid_req_code', // 前置校验编码
- 'tag_ids', // 套餐标签
- 'shop_tag_ids', // 小店套餐标签
- 'data_orientation', // 定向流量
- 'data_usual', // 通用流量
- 'is_live', // 是否允许直播 0:不允许 1:允许
- 'deleted_at', // 删除时间
- 'yj_api',
- 'ident_image', // 运营商标识图
- 'delist_time', // 下架时间
- 'product_type', // 产品类型 0号卡 1宽带
- 'internet_speed', // 网速
- 'supplier_id', // 供货商id
- 'commission_terms', // 结佣条件
- 'package_key',// 套餐秘钥
- ];
- // 查询字段
- public static $selectFields = [
- 'id',
- 'name', // 名称
- 'price',
- 'mini_text', // 简介
- 'image', // 主图
- 'details', // 详情
- 'operator_id', // 运营商
- 'yj',
- 'yjzc', // 佣金政策
- 'type_id', // 套餐类型
- 'monthly_rent', // 月租
- 'weight', // 权重
- // 'upstream_code', // 上游套餐编码
- // 'production_type_id', // 生产方式
- 'is_upload', // 是否上架
- 'need_idcard', // 是否需要身份证号
- 'is_upload_idcard', // 是否需要上传身份证照片
- // 'status', // 状态
- 'created_at',
- 'updated_at',
- 'out_package_id', // 外部产品编码
- 'belonging_place', // 归属地
- 'data_quota', // 流量额度
- 'call_duration', // 通话时长
- 'is_choose_number', // 是否可选号
- 'first_recharge_amount', // 首充金额
- 'direct_send_status', // 直接提交局方,0表示不提,1表示提
- 'uporlocal', // 线上或本地号库切换,默认为0:无号库,1:本地号库,2:线上号库
- 'color', // 颜色
- 'min_age', // 最小年龄
- 'max_age', // 最大年龄
- 'family_number', // 亲情号
- 'beautiful_number', // 靓号
- 'ownership_change', // 可否自选归属地
- 'discount_month', // 优惠有效期,单位月
- 'month_rent', // 套餐月租
- 'general_traffic', // 通用流量
- 'directional_traffic', // 定向流量
- 'long_short_tariff', // 长期资费/短期资费
- 'interest', // 附带权益
- 'original_month_rent', // 原月租
- 'sensitive_areas',
- 'cover_img', // 封面图
- 'attention', // 注意事项
- 'noly_delivery_area', // 只发货地区
- 'bright', // 亮点
- 'rebate_type', // 返佣类型 1:次月返 2:秒返
- // 'knowledge_base', // 知识库
- 'select_status', // 是否选号
- 'is_valid', // 是否校验
- 'valid_req_code', // 前置校验编码
- 'tag_ids', // 套餐标签
- 'shop_tag_ids', // 小店套餐标签
- 'data_orientation', // 定向流量
- 'data_usual', // 通用流量
- 'is_live', // 是否允许直播 0:不允许 1:允许
- 'deleted_at', // 删除时间
- // 'yj_api',
- 'ident_image', // 运营商标识图
- 'delist_time', // 下架时间
- 'product_type', // 产品类型 0号卡 1宽带
- 'internet_speed', // 网速
- 'supplier_id', // 供货商id
- 'commission_terms', // 结佣条件
- 'package_key',// 套餐秘钥
- ];
- // 小店套餐查询字段
- public static $selectFieldsByShop = [
- 'id',
- 'name', // 名称
- 'price',
- 'mini_text', // 简介
- 'image', // 主图
- 'details', // 详情
- 'operator_id', // 运营商
- 'yjzc', // 佣金政策
- 'type_id', // 套餐类型
- 'monthly_rent', // 月租
- 'weight', // 权重
- 'is_upload', // 是否上架
- 'need_idcard', // 是否需要身份证号
- 'is_upload_idcard', // 是否需要上传身份证照片
- 'created_at',
- 'belonging_place', // 归属地
- 'data_quota', // 流量额度
- 'call_duration', // 通话时长
- 'is_choose_number', // 是否可选号
- 'first_recharge_amount', // 首充金额
- 'min_age', // 最小年龄
- 'max_age', // 最大年龄
- 'discount_month', // 优惠有效期,单位月
- 'month_rent', // 套餐月租
- 'general_traffic', // 通用流量
- 'directional_traffic', // 定向流量
- 'long_short_tariff', // 长期资费/短期资费
- 'interest', // 附带权益
- 'original_month_rent', // 原月租
- 'cover_img', // 封面图
- 'attention', // 注意事项
- 'noly_delivery_area', // 只发货地区
- 'bright', // 亮点
- 'rebate_type', // 返佣类型 1:次月返 2:秒返
- // 'knowledge_base', // 知识库
- 'select_status', // 是否选号
- 'is_valid', // 是否校验
- 'valid_req_code', // 前置校验编码
- 'tag_ids', // 套餐标签
- 'shop_tag_ids', // 小店套餐标签
- 'data_orientation', // 定向流量
- 'data_usual', // 通用流量
- 'ident_image', // 运营商标识图
- 'delist_time', // 下架时间
- 'internet_speed', // 网速
- 'commission_terms', // 结佣条件
- 'package_key',// 套餐秘钥
- ];
- // 是否允许直播
- const IS_LIVE_ALLOW = 1;
- const IS_LIVE_NOT_ALLOW = 0;
- public static $isLive = [
- self::IS_LIVE_ALLOW => '允许',
- self::IS_LIVE_NOT_ALLOW => '不允许',
- ];
- // 是否上架
- const IS_UPLOAD_YES = 1;
- const IS_UPLOAD_NO = 0;
- public static $isUpload = [
- self::IS_UPLOAD_YES => '上架',
- self::IS_UPLOAD_NO => '下架',
- ];
- // 返佣类型
- const REBATE_TYPE_MONTH = 1;
- const REBATE_TYPE_SECOND = 2;
- public static $rebateType = [
- self::REBATE_TYPE_MONTH => '次月返',
- self::REBATE_TYPE_SECOND => '秒返',
- ];
- // 是否选号
- const SELECT_STATUS_YES = 1;
- const SELECT_STATUS_NO = 0;
- public static $selectStatus = [
- self::SELECT_STATUS_YES => '是',
- self::SELECT_STATUS_NO => '否',
- ];
- public function suppliers()
- {
- return $this->belongsTo(Suppliers::class, 'supplier_id', 'id')->select(['id', 'name']);
- }
- }
|