|
@@ -27,6 +27,7 @@ class Mobile extends Backend
|
|
|
* @var \app\admin\model\Mobile
|
|
|
*/
|
|
|
protected $model = null;
|
|
|
+ protected $relationSearch=true;
|
|
|
|
|
|
public function _initialize()
|
|
|
{
|
|
@@ -65,12 +66,21 @@ class Mobile extends Backend
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
|
|
|
|
$list = $this->model
|
|
|
-
|
|
|
+ ->with('info')
|
|
|
->where($where)
|
|
|
->order($sort, $order)
|
|
|
->paginate($limit);
|
|
|
|
|
|
foreach ($list as $row) {
|
|
|
+ $rules=[];
|
|
|
+ foreach (MobileConstant::getFilters() as $rule=>$field){
|
|
|
+ foreach (array_values($field) as $column){
|
|
|
+ if($row[$column]==1){
|
|
|
+ $rules[]=$rule;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $row['rules']=array_unique($rules);
|
|
|
}
|
|
|
|
|
|
$result = array("total" => $list->total(), "rows" => $list->items());
|
|
@@ -79,6 +89,7 @@ class Mobile extends Backend
|
|
|
}
|
|
|
$this->assign('no_type',array_column(MobileConstant::getNoType(),'name','id'));
|
|
|
$this->assign('network',array_column(MobileConstant::getNetwork(),'name','id'));
|
|
|
+ $this->assign('filters',MobileConstant::getFilters());
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
|