PlatformChannel.php 753 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace app\admin\model;
  3. class PlatformChannel extends Base
  4. {
  5. //设置字段信息
  6. protected $schema = [
  7. 'id' =>'bigint',//
  8. 'platform_id' =>'int',//平台id
  9. 'channel_id' =>'int',//渠道id
  10. 'weight' =>'double',//排序权重
  11. 'apply_id' =>'int',//
  12. 'apply_name' =>'varchar',//
  13. 'is_del' =>'tinyint',//
  14. 'addtime' =>'datetime',//
  15. 'updatetime' =>'datetime',//
  16. ];
  17. protected $createTime='addtime';
  18. protected $updateTime='updatetime';
  19. public function channel(){
  20. return $this->belongsTo(Channel::class,'channel_id','id')->where(['is_del'=>0])->bind(['channel_name',"companyName","companyNo"]);
  21. }
  22. }