Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
f7cebc13
Commit
f7cebc13
authored
Oct 30, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
3e2a9cbe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
9 deletions
+54
-9
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+21
-0
Goods.php
application/models/DAO/Goods.php
+21
-0
Shopkeeper.php
application/modules/Client/controllers/Shopkeeper.php
+10
-2
application.ini
conf/application.ini
+2
-4
url.ini
conf/url.ini
+0
-3
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
f7cebc13
...
...
@@ -7,10 +7,31 @@ use Zend\Json\Server\Exception\ErrorException;
class
GoodsCommonServiceModel
extends
\Business\AbstractModel
{
private
$goodsStorageField
=
'goods_id goodsId,goods_name goodsName,goods_verify goodsVerify,goods_state goodsState,goods_image goodsImage,goods_price goodsPrice,goods_storage goodsStorage,goods_spec goodsAttr'
;
public
function
init
()
{
}
/**
* 获取商品库存方法
*
*/
public
function
getGoodsStorageList
(
$storeId
,
$pageIndex
=
ApiConst
::
zero
,
$pageSize
=
ApiConst
::
pageSize
)
{
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$where
=
array
();
$where
[]
=
'store_id = '
.
$storeId
;
$where
[]
=
'goods_storage<=goods_storage_alarm'
;
//获得列表
$datas
=
$goodsDao
->
getListPage
(
implode
(
$where
,
' and '
),
$this
->
goodsStorageField
,
$pageIndex
,
$pageSize
);
//获得售后商品列表getOrderGoodsByRecIds
if
(
!
empty
(
$datas
))
{
return
$datas
;
}
else
{
return
new
\stdClass
();
}
}
/**
* 验证商品是否存在
...
...
application/models/DAO/Goods.php
View file @
f7cebc13
...
...
@@ -29,6 +29,27 @@ class GoodsModel extends \DAO\AbstractModel {
public
function
init
(){
}
/**
*
* 分页获取商品列表
* @param $where
* @param $field
* @param $pageIndex
* @param $pageSize
* @param array $order
* @return array|mixed
*/
public
function
getListPage
(
$where
,
$field
,
$pageIndex
,
$pageSize
,
$order
=
array
(
'goods_id'
=>
'asc'
))
{
$this
->
setDb
(
$this
->
dbName
);
if
(
$datas
=
$this
->
lists
(
$where
,
$order
,
$field
,
$pageIndex
,
$pageSize
))
{
foreach
(
$datas
[
'list'
]
as
$key
=>
$val
)
{
$datas
[
'list'
][
$key
][
'goodsAttr'
]
=
$this
->
getFormatGoodsAttr
(
$val
[
'goodsAttrs'
]);
}
}
return
$datas
?
$datas
:
array
();
}
public
function
getList
(
$where
,
$field
){
$this
->
setDb
();
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchAll
();
...
...
application/modules/Client/controllers/Shopkeeper.php
View file @
f7cebc13
...
...
@@ -181,7 +181,7 @@ class ShopkeeperController extends \Our\Controller_AbstractApi {
/**
* 获得售后列表
*/
public
function
getRefunds
(){
public
function
getRefunds
Action
(){
$refundService
=
\Business\Order\RefundServiceModel
::
getInstance
();
$pageIndex
=
$this
->
getPageIndex
();
$pageSize
=
$this
->
getPageSize
();
...
...
@@ -189,5 +189,13 @@ class ShopkeeperController extends \Our\Controller_AbstractApi {
$this
->
success
(
$res
);
}
/**
* 单一属性商品库存预警
*/
public
function
warningAction
(){
$goodsCommonService
=
\Business\Goods\GoodsCommonServiceModel
::
getInstance
();
$pageIndex
=
$this
->
getPageIndex
();
$pageSize
=
$this
->
getPageSize
();
$res
=
$goodsCommonService
->
getGoodsStorageList
(
$this
->
memberId
,
$pageIndex
,
$pageSize
);
}
}
conf/application.ini
View file @
f7cebc13
...
...
@@ -437,7 +437,6 @@ push.user.service.type=7
elastic.master.host
=
"192.168.1.201"
elastic.master.port
=
"9200"
elastic.master.scheme
=
"http"
;
<<<<<<< HEAD
[linqing : common]
; 数据库配置
...
...
@@ -469,6 +468,7 @@ out.config="/data/config";
;锁文件
out.locks="/data/locks";
; redis配置
password.key
=
'~!@#$`1234qwertasdfgzxcvb'
;redis.database.params.password = "test"
;推送配置
...
...
@@ -484,6 +484,4 @@ elastic.master.scheme="http";
;resources.database.params.hostname = "127.0.0.1"
;resources.database.params.database = "database"
;resources.database.params.username = "username"
;resources.database.params.password = "password"
=======
>>>>>>>
c3e337b21d2c6cf6591e49b1be65c50fb746b2e8
;resources.database.params.password = "password"
\ No newline at end of file
conf/url.ini
View file @
f7cebc13
...
...
@@ -180,7 +180,6 @@ config.url.pushHost="127.0.0.1:9503";
config.url.convert
=
"/usr/local/bin/wkhtmltoimage"
;
config.url.indexUrl="/www/local.qm.com/application/library/React"
config.url.libary
=
"/www/local.qm.com/application/library"
<<<<<<<
HEAD
[linqing : common]
...
...
@@ -218,5 +217,3 @@ config.url.convert="/usr/local/bin/wkhtmltoimage";
config.url.indexUrl="/www/local.qm.com/application/library/React"
config.url.libary
=
"/www/local.qm.com/application/library"
; 文件目录
=======
>>>>>>>
c3e337b21d2c6cf6591e49b1be65c50fb746b2e8
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