DistributionSelfDefineConfig.php 873 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Modules\OfficialAccount\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class DistributionSelfDefineConfig extends Model
  5. {
  6. protected $tables = 'distribution_self_define_configs';
  7. protected $fillable = ['distribution_channel_id','company_id','desc','status','type','created_at','updated_at'];
  8. static function getDistributionSelfDefineConfig($distribution_channel_id,$type)
  9. {
  10. return self::where(['distribution_channel_id'=>$distribution_channel_id,'type'=>$type,'status'=>1])->first();
  11. }
  12. static function getDistributionChannelSwitchByCategoryAndCompany($company_id,$type)
  13. {
  14. return self::where(['company_id'=>$company_id,'type'=>$type,'status'=>1])->first();
  15. }
  16. static function getDistributionsByType($type)
  17. {
  18. return self::where(['type'=>$type,'status'=>1])->get();
  19. }
  20. }