mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update ShopGoods.php
This commit is contained in:
parent
3e753de812
commit
e32caacf03
@ -45,13 +45,13 @@ class ShopGoods extends Controller
|
|||||||
{
|
{
|
||||||
$this->title = '商品数据管理';
|
$this->title = '商品数据管理';
|
||||||
$query = $this->_query($this->table);
|
$query = $this->_query($this->table);
|
||||||
$query->like('code,name,mark')->equal('status,cate');
|
|
||||||
// 加载对应数据
|
// 加载对应数据
|
||||||
$this->type = $this->request->get('type', 'index');
|
$this->type = $this->request->get('type', 'index');
|
||||||
if ($this->type === 'index') $query->where(['deleted' => 0]);
|
if ($this->type === 'index') $query->where(['deleted' => 0]);
|
||||||
elseif ($this->type === 'recycle') $query->where(['deleted' => 1]);
|
elseif ($this->type === 'recycle') $query->where(['deleted' => 1]);
|
||||||
else $this->error("无法加载 {$this->type} 数据列表!");
|
else $this->error("无法加载 {$this->type} 数据列表!");
|
||||||
// 列表排序并显示
|
// 列表排序并显示
|
||||||
|
$query->like('code,name,mark')->equal('status,cate');
|
||||||
$query->order('sort desc,id desc')->page();
|
$query->order('sort desc,id desc')->page();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,8 +154,7 @@ class ShopGoods extends Controller
|
|||||||
}
|
}
|
||||||
if ($this->request->isGet()) {
|
if ($this->request->isGet()) {
|
||||||
$data['mark'] = str2arr($data['mark'] ?? '');
|
$data['mark'] = str2arr($data['mark'] ?? '');
|
||||||
$this->marks = GoodsService::instance()->getMarkList();
|
[$this->marks, $this->cates] = [GoodsService::instance()->getMarkList(), GoodsService::instance()->getCateList('arr2table')];
|
||||||
$this->cates = GoodsService::instance()->getCateList('arr2table');
|
|
||||||
$fields = 'goods_sku `sku`,goods_code,goods_spec `key`,price_selling `selling`,price_market `market`,number_virtual `virtual`,number_express `express`,status';
|
$fields = 'goods_sku `sku`,goods_code,goods_spec `key`,price_selling `selling`,price_market `market`,number_virtual `virtual`,number_express `express`,status';
|
||||||
$data['data_items'] = json_encode($this->app->db->name('ShopGoodsItem')->where(['goods_code' => $data['code']])->column($fields, 'goods_spec'), JSON_UNESCAPED_UNICODE);
|
$data['data_items'] = json_encode($this->app->db->name('ShopGoodsItem')->where(['goods_code' => $data['code']])->column($fields, 'goods_spec'), JSON_UNESCAPED_UNICODE);
|
||||||
$data['truck_items'] = $this->app->db->name('ShopTruckTemplate')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('code,name');
|
$data['truck_items'] = $this->app->db->name('ShopTruckTemplate')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('code,name');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user