[更新]修改商品库存管理

This commit is contained in:
Anyon 2019-04-04 10:15:35 +08:00
parent f33d8b0886
commit e8b38b65cc
2 changed files with 6 additions and 4 deletions

View File

@ -43,7 +43,7 @@ class Goods extends Controller
public function index()
{
$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, [
'goods_id' => $post['goods_id'][$key],
'goods_spec' => $post['goods_spec'][$key],
'number_stock' => $post['number'][$key],
'number_stock' => $post['goods_number'][$key],
]);
if (!empty($data)) {
Db::name('StoreGoodsStock')->insertAll($data);

View File

@ -43,7 +43,7 @@
<td class="padding-0" width="10%">
<input type="hidden" name="goods_id[]" value="{$goods.goods_id|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>
</tr>
<!--{/foreach}-->
@ -58,7 +58,9 @@
<div class="layui-form-item text-center">
<button class="layui-btn" type='submit'>确定入库</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>
</form>