|
@@ -80,6 +80,27 @@ class DistProductCategory extends EloquentRepository
|
|
|
return $selectOptions;
|
|
|
}
|
|
|
|
|
|
+ public static function selectOptionsShowTow(\Closure $closure = null)
|
|
|
+ {
|
|
|
+ if (!$closure) {
|
|
|
+ $closure = function ($query) {
|
|
|
+ $query = $query->where('dist_id', getDistributorId());
|
|
|
+ $query = $query->where('enabled', 1);
|
|
|
+ $query = $query->orderBy('order', 'desc')->orderBy('id', 'desc');
|
|
|
+ return $query;
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ $selectOptions = Model::class::selectOptions($closure);
|
|
|
+ //只显示2层
|
|
|
+ foreach ($selectOptions as $key => $value) {
|
|
|
+ if (substr_count($value,' ') > 8) {
|
|
|
+ unset($selectOptions[$key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $selectOptions;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static function getParameter($categoryId)
|
|
|
{
|