作者 liwei

修改bug

... ... @@ -57,11 +57,10 @@ class Excel extends Backend
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['recipecon', 'material'])
->with(['recipecon', 'material','material_con'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->getRelation('recipecon')->visible(['title']);
... ... @@ -69,7 +68,7 @@ class Excel extends Backend
}
$result = array("total" => $list->total(), "rows" => $list->items());
// dump(json($result));exit;
return json($result);
}
return $this->view->fetch();
... ... @@ -83,6 +82,7 @@ class Excel extends Backend
{
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
$params = $this->preExcludeFields($params);
... ...
... ... @@ -65,7 +65,7 @@ class RecipeCon extends Backend
}
$result = array("total" => $list->total(), "rows" => $list->items());
// dump( json($result));exit();
return json($result);
}
return $this->view->fetch();
... ...
... ... @@ -56,4 +56,8 @@ class Excel extends Model
{
return $this->belongsTo('Material', 'material_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function materialCon()
{
return $this->belongsTo('MaterialCon', 'material_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
... ... @@ -37,8 +37,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
searchList: {"1": __('Type 1'), "0": __('Type 0')},
formatter: Table.api.formatter.normal
},
{field: 'material.title', title: __('跳转原料'), operate: 'LIKE'},
// {field: 'material_id', title: __('Material_id')},
{field: 'material_con.title', title: __('跳转原料'), operate: 'LIKE'},
{field: 'material_id', title: __('Material_id')},
// {field: 'recipecon.title', title: __('Recipecon.title'), operate: 'LIKE'},
{
field: 'operate',
... ...