mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]修改商品库存管理
This commit is contained in:
parent
f33d8b0886
commit
e8b38b65cc
@ -43,7 +43,7 @@ class Goods extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->title = '商品管理';
|
$this->title = '商品管理';
|
||||||
return $this->_query($this->table)->equal('status,vip_mod,cate_id')->like('title')->where(['is_deleted' => '0'])->order('sort asc,id desc')->page();
|
$this->_query($this->table)->equal('status,vip_mod,cate_id')->like('title')->where(['is_deleted' => '0'])->order('sort asc,id desc')->page();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,7 +87,7 @@ class Goods extends Controller
|
|||||||
foreach (array_keys($post['goods_id']) as $key) if ($post['number'][$key] > 0) array_push($data, [
|
foreach (array_keys($post['goods_id']) as $key) if ($post['number'][$key] > 0) array_push($data, [
|
||||||
'goods_id' => $post['goods_id'][$key],
|
'goods_id' => $post['goods_id'][$key],
|
||||||
'goods_spec' => $post['goods_spec'][$key],
|
'goods_spec' => $post['goods_spec'][$key],
|
||||||
'number_stock' => $post['number'][$key],
|
'number_stock' => $post['goods_number'][$key],
|
||||||
]);
|
]);
|
||||||
if (!empty($data)) {
|
if (!empty($data)) {
|
||||||
Db::name('StoreGoodsStock')->insertAll($data);
|
Db::name('StoreGoodsStock')->insertAll($data);
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
<td class="padding-0" width="10%">
|
<td class="padding-0" width="10%">
|
||||||
<input type="hidden" name="goods_id[]" value="{$goods.goods_id|default=''}">
|
<input type="hidden" name="goods_id[]" value="{$goods.goods_id|default=''}">
|
||||||
<input type="hidden" name="goods_spec[]" value="{$goods.goods_spec|default=''}">
|
<input type="hidden" name="goods_spec[]" value="{$goods.goods_spec|default=''}">
|
||||||
<input class="layui-input text-center border-0 padding-left-0" onblur="this.value=parseInt(this.value)||0" name="number[]" value="0">
|
<input class="layui-input text-center border-0 padding-left-0" onblur="this.value=parseInt(this.value)||0" name="goods_number[]" value="0">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--{/foreach}-->
|
<!--{/foreach}-->
|
||||||
@ -58,7 +58,9 @@
|
|||||||
<div class="layui-form-item text-center">
|
<div class="layui-form-item text-center">
|
||||||
<button class="layui-btn" type='submit'>确定入库</button>
|
<button class="layui-btn" type='submit'>确定入库</button>
|
||||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消入库吗?" data-close>取消入库</button>
|
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消入库吗?" data-close>取消入库</button>
|
||||||
<!--{notempty name='vo.id'}--><input type='hidden' value='{$vo.id}' name='id'><!--{/notempty}-->
|
<!--{notempty name='vo.id'}-->
|
||||||
|
<input type='hidden' value='{$vo.id}' name='id'>
|
||||||
|
<!--{/notempty}-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user