Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dsyerp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
dsyerp
Commits
3865c7c0
Commit
3865c7c0
authored
Nov 11, 2023
by
wxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加产品显示库存
parent
7948c467
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
module/Store/src/Repository/GoodsRepository.php
module/Store/src/Repository/GoodsRepository.php
+1
-1
module/Store/view/store/goods/ajax-goods-search.phtml
module/Store/view/store/goods/ajax-goods-search.phtml
+3
-0
No files found.
module/Store/src/Repository/GoodsRepository.php
View file @
3865c7c0
...
@@ -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
);
...
...
module/Store/view/store/goods/ajax-goods-search.phtml
View file @
3865c7c0
...
@@ -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
}
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment