链街Dcat后台
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.

38 lines
855 B

6 years ago
  1. <?php
  2. namespace App\Models;
  3. use Dcat\Admin\Traits\HasDateTimeFormatter;
  4. use Illuminate\Database\Eloquent\Model;
  5. class LanzuMmInfo extends Model
  6. {
  7. use HasDateTimeFormatter;
  8. protected $table = 'lanzu_mm_info';
  9. protected $dateFormat = 'U';
  10. public function Withdraw()
  11. {
  12. return $this->hasOne('\App\Models\LanzuMmWithdraw','mm_id','id');
  13. }
  14. /**
  15. * 获取市场经理(只搜索状态是正常的经理)
  16. * id为键,name为值
  17. */
  18. public static function getMmInfoArray()
  19. {
  20. $list = self::select('id','name')
  21. ->where('is_del',0)
  22. ->where('status',1)
  23. ->get();
  24. $array = [];
  25. if(count($list) > 0){
  26. foreach ($list as $key => $value){
  27. $array[$value->id] = $value->name;
  28. }
  29. }
  30. return $array;
  31. }
  32. }