作者 SHW\戥岁。。

类别通用搜索

... ... @@ -29,6 +29,7 @@ class Litestoregoods extends Backend
*/
protected $model = null;
protected $spec_model = null;
// protected $searchFields = 'category.name';
public function _initialize()
{
... ... @@ -70,7 +71,7 @@ class Litestoregoods extends Backend
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
list($where, $sort, $order, $offset, $limit) = $this->buildparams("category.name",true);
$total = $this->model
->with(['category', 'activity'])
->where($where)
... ...
... ... @@ -31,7 +31,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'litestor
{field: 'goods_id', title: __('Goods_id')},
{field: 'goods_name', title: __('Goods_name'), operate: 'LIKE'},
{field: 'keywords', title: __('Keywords'), operate: 'LIKE'},
{field: 'category.name', title: __('Category.name'), operate: false},
{field: 'category.name', title: __('Category.name'), operate: 'LIKE'},
{field: 'activity.name', title: __('Activity.name'), operate: false},
{field: 'category_id', visible: false, title: __('Category_id')},
{field: 'image', title: __('Image'), formatter: Table.api.formatter.image},
... ...