作者 SHW\戥岁。。

库存

... ... @@ -2,6 +2,7 @@
namespace app\admin\controller\litestore;
use app\admin\model\Activity;
use app\admin\model\litestore\Litestoregoodsspec;
use app\common\controller\Backend;
use app\admin\model\litestore\Litestorespec as SpecModel;
... ... @@ -29,17 +30,16 @@ class Litestoregoods extends Backend
*/
protected $model = null;
protected $spec_model = null;
// protected $searchFields = 'category.name';
protected $activity = null;
public function _initialize()
{
parent::_initialize();
$this->SpecModel = new SpecModel;
$this->SpecValueModel = new SpecValueModel;
$this->model = new \app\admin\model\litestore\Litestoregoods;
$this->spec_model = new \app\admin\model\litestore\Litestoregoodsspec();
$this->activity = new Activity();
$this->model = new \app\admin\model\litestore\Litestoregoods;
$this->spec_model = new \app\admin\model\litestore\Litestoregoodsspec();
$this->view->assign("specTypeList", $this->model->getSpecTypeList());
$this->view->assign("deductStockTypeList", $this->model->getDeductStockTypeList());
$this->view->assign("goodsStatusList", $this->model->getGoodsStatusList());
... ... @@ -98,7 +98,16 @@ class Litestoregoods extends Backend
return json($result);
}
$category_name1 = $this->activity
->where('id', 1)->value('name');
$category_name2 = $this->activity
->where('id', 2)->value('name');
$category_name3 = $this->activity
->where('id', 3)->value('name');
$this->assign('template', $this->request->domain() . '/static/template/商品导入模板.xlsx');
$this->assign('name1', $category_name1);
$this->assign('name2', $category_name2);
$this->assign('name3', $category_name3);
return $this->view->fetch();
}
... ...
... ... @@ -35,9 +35,9 @@
<div class="dropdown btn-group {:$auth->check('litestore/litestoregoods/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-check-square-o"></i> {:__('批量添加活动商品')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="activity_id=1"><i class="fa fa-free-code-camp"></i> {:__('新人用户')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="activity_id=2"><i class="fa fa-clock-o"></i> {:__('限时秒杀')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="activity_id=3"><i class="fa fa-location-arrow"></i> {:__('进口商品')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="activity_id=1"><i class="fa fa-free-code-camp"></i> {$name1}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="activity_id=2"><i class="fa fa-clock-o"></i> {$name2}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="activity_id=3"><i class="fa fa-location-arrow"></i> {$name3}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="activity_id=0"><i class="fa fa-eye-slash"></i> {:__('不参与活动')}</a></li>
</ul>
</div>
... ...
... ... @@ -18,7 +18,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'litestor
});
var table = $("#table");
table.on('post-common-search.bs.table', function (event, table) {
var form = $("form", table.$commonsearch);
$("input[name='category_id']", form).addClass("selectpage").data("source", "litestore/litestorecategory/index").data("primaryKey", "id").data("field", "name").data("orderBy", "id desc").data("pageSize",1);
Form.events.cxselect(form);
Form.events.selectpage(form);
});
table.on('post-common-search.bs.table', function (event, table) {
var form = $("form", table.$commonsearch);
$("input[name='activity_id']", form).addClass("selectpage").data("source", "activity/index").data("primaryKey", "id").data("field", "name").data("orderBy", "id desc").data("pageSize",1);
Form.events.cxselect(form);
Form.events.selectpage(form);
});
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
... ... @@ -33,9 +44,10 @@ 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: 'LIKE'},
{field: 'category.name', title: __('Category.name'), operate: false},
{field: 'activity.name', title: __('Activity.name'), operate: 'LIKE'},
// {field: 'category_id', visible: false, title: __('Category_id')},
{field: 'category_id', visible: false, title: __('Category_id'),operate: 'LIKE %...%'},
{field: 'activity_id', visible: false, title: __('Activity_id'),operate: 'LIKE %...%'},
{field: 'image', title: __('Image'), formatter: Table.api.formatter.image},
{field: 'images', title: __('Images'), formatter: Table.api.formatter.images},
{
... ...