|
|
|
@ -34,17 +34,18 @@ class Market extends Model |
|
|
|
*/ |
|
|
|
public static function getMarketArray($where = [], $options = []) |
|
|
|
{ |
|
|
|
$model = self::where('status',1) |
|
|
|
->whereNull('deleted_at'); |
|
|
|
$model = self::whereNull('deleted_at'); |
|
|
|
// ->where('status',1)
|
|
|
|
|
|
|
|
if(!empty($where)){ |
|
|
|
$model->where($where); |
|
|
|
} |
|
|
|
$list = $model->pluck('name','id')->toArray(); |
|
|
|
$list = $model->pluck('id','name')->toArray(); |
|
|
|
if(!empty($options)){ |
|
|
|
return array_merge($options,$list); |
|
|
|
$new = array_merge($options,$list); |
|
|
|
return array_flip($new); |
|
|
|
}else{ |
|
|
|
return $list; |
|
|
|
return array_flip($list); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|