Commit 3865c7c0 authored by wxl's avatar wxl

添加产品显示库存

parent 7948c467
......@@ -64,7 +64,7 @@ class GoodsRepository extends EntityRepository
{
//当定义为某个字段时,输出的是数组
$query = $this->getEntityManager()->createQueryBuilder()
->select('g.goodsId,g.goodsName,g.goodsSpec')
->select('g.goodsId,g.goodsName,g.goodsSpec,g.goodsStock')
->from(Goods::class, 'g')
->where('g.goodsName LIKE \'%'.$goodsName.'%\'')
->setMaxResults(10);
......
......@@ -25,6 +25,7 @@
<th width="15%"><?php echo $this->translate('商品编号'); ?></th>
<th><?php echo $this->translate('商品名称'); ?></th>
<th><?php echo $this->translate('商品规格'); ?></th>
<th><?php echo $this->translate('库存'); ?></th>
<th width="10%"><?php echo $this->translate('操作'); ?></th>
</tr>
</thead>
......@@ -39,6 +40,8 @@
</td>
<td><?php echo empty($goods->getGoodsSpec()) ? $this->translate('无') : $this->escapeHtml($goods->getGoodsSpec()); ?>
</td>
<td><?php echo $this->escapeHtml($goods->getGoodsStock()); ?>
</td>
<td><button type="button" class="btn btn-primary btn-sm" onclick="addSelectGoods(<?php echo $goods->getGoodsId(); ?>);"><?php echo $this->translate('点击添加'); ?></button></td>
</tr>
<?php } ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment