Commit 3865c7c0 authored by wxl's avatar wxl

添加产品显示库存

parent 7948c467
...@@ -64,7 +64,7 @@ class GoodsRepository extends EntityRepository ...@@ -64,7 +64,7 @@ class GoodsRepository extends EntityRepository
{ {
//当定义为某个字段时,输出的是数组 //当定义为某个字段时,输出的是数组
$query = $this->getEntityManager()->createQueryBuilder() $query = $this->getEntityManager()->createQueryBuilder()
->select('g.goodsId,g.goodsName,g.goodsSpec') ->select('g.goodsId,g.goodsName,g.goodsSpec,g.goodsStock')
->from(Goods::class, 'g') ->from(Goods::class, 'g')
->where('g.goodsName LIKE \'%'.$goodsName.'%\'') ->where('g.goodsName LIKE \'%'.$goodsName.'%\'')
->setMaxResults(10); ->setMaxResults(10);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<th width="15%"><?php echo $this->translate('商品编号'); ?></th> <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><?php echo $this->translate('商品规格'); ?></th>
<th><?php echo $this->translate('库存'); ?></th>
<th width="10%"><?php echo $this->translate('操作'); ?></th> <th width="10%"><?php echo $this->translate('操作'); ?></th>
</tr> </tr>
</thead> </thead>
...@@ -39,6 +40,8 @@ ...@@ -39,6 +40,8 @@
</td> </td>
<td><?php echo empty($goods->getGoodsSpec()) ? $this->translate('无') : $this->escapeHtml($goods->getGoodsSpec()); ?> <td><?php echo empty($goods->getGoodsSpec()) ? $this->translate('无') : $this->escapeHtml($goods->getGoodsSpec()); ?>
</td> </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> <td><button type="button" class="btn btn-primary btn-sm" onclick="addSelectGoods(<?php echo $goods->getGoodsId(); ?>);"><?php echo $this->translate('点击添加'); ?></button></td>
</tr> </tr>
<?php } ?> <?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