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
a2810dab
Commit
a2810dab
authored
Nov 03, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc
parent
3ed800a0
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
7 deletions
+41
-7
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+6
-6
ApiConst.php
application/library/Our/ApiConst.php
+6
-1
NameConst.php
application/library/Our/NameConst.php
+2
-0
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+13
-0
Goods.php
application/models/DAO/Goods.php
+4
-0
jpush.php
scripts/crontab/push/jpush.php
+10
-0
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
a2810dab
...
...
@@ -234,9 +234,9 @@ class OrderConfirmUtil {
$deliveryFee
=
$temp
[
'shippingFee'
];
}
//
if($deliveryFee!=$requestData['deliveryFee']){
//
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongStoreDeliveryFeeForOrder);
//
}
if
(
$deliveryFee
!=
$requestData
[
'deliveryFee'
]){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
wrongStoreDeliveryFeeForOrder
);
}
$delivery
[
'deliveryFee'
]
=
$deliveryFee
;
$delivery
[
'deliveryType'
]
=
$requestData
[
'deliveryType'
];
$delivery
[
'deliveryTime'
]
=
isset
(
$deliveryTime
)
?
$deliveryTime
:
\Our\ApiConst
::
zero
;
...
...
@@ -253,9 +253,9 @@ class OrderConfirmUtil {
if
(
$orderAmount
<=
\Our\ApiConst
::
zero
){
$orderAmount
=
\Our\ApiConst
::
zero
;
}
//
if($orderAmount!=$requestData['totalFee']){
//
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongTotalFeeForOrder);
//
}
if
(
$orderAmount
!=
$requestData
[
'totalFee'
]){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
wrongTotalFeeForOrder
);
}
$storeCartData
[
'cartList'
][
$storeId
][
'orderAmount'
]
=
$orderAmount
;
}
return
$storeCartData
;
...
...
application/library/Our/ApiConst.php
View file @
a2810dab
...
...
@@ -22,6 +22,9 @@ class ApiConst
//一个小时
const
oneHour
=
3600
;
//预警时间
const
storageAlarmHour
=
10800
;
const
twoMinSecond
=
120
;
const
fiveMinutes
=
180
;
...
...
@@ -418,7 +421,9 @@ class ApiConst
//售后待收货
const
messageRefundWaitReceive
=
105
;
//用户被其它用户登录请退出
const
messageOtherLogin
=
106
;
const
messageGoodsAlert
=
106
;
//用户被其它用户登录请退出
const
messageOtherLogin
=
107
;
//消息按钮类型
const
messageButtonTypeConfirmButton
=
1
;
//确认收货
const
messageButtonTypeReciverButton
=
2
;
//确认接单
...
...
application/library/Our/NameConst.php
View file @
a2810dab
...
...
@@ -174,6 +174,8 @@ class NameConst {
const
add
=
'add'
;
const
reduce
=
'reduce'
;
const
set
=
'set'
;
const
logOut
=
'logOut'
;
}
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
a2810dab
...
...
@@ -3,6 +3,8 @@
namespace
Business\Goods
;
use
Our\ApiConst
;
use
Our\Common
;
use
Zend\Json\Server\Exception\ErrorException
;
class
GoodsCommonServiceModel
extends
\Business\AbstractModel
...
...
@@ -1286,4 +1288,15 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
return
self
::
$_instance
;
}
public
function
getAlertGoods
(){
$goodsDao
=
\DAO\GoodsModel
::
getInstance
();
$endTime
=
TIMESTAMP
;
$beginTime
=
TIMESTAMP
-
ApiConst
::
storageAlarmHour
;
$where
=
Common
::
format
(
" goods_edittime >
{
0
}
and goods_edittime<
{
1
}
and goods_storage<goods_storage_alarm"
,
$beginTime
,
$endTime
);
$stores
=
$goodsDao
->
getListGroup
(
$where
,
"store_id as storeId,count(*) as count"
,
"store_id"
);
return
$stores
;
}
}
application/models/DAO/Goods.php
View file @
a2810dab
...
...
@@ -73,6 +73,10 @@ class GoodsModel extends \DAO\AbstractModel {
$this
->
setDb
();
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchAll
();
}
public
function
getListGroup
(
$where
,
$field
,
$groupField
){
$this
->
setDb
(
$this
->
dbName
);
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
group
(
$groupField
)
->
fetchAll
();
}
// public function getOneById($id){
// $this->setDb();
// return $this->db->select('goods_id,goods_commonid,goods_price,goods_marketprice,goods_image,goods_storage,goods_spec')->from($this->_tableName)->where(array('goods_id'=>$id))->fetchOne();
...
...
scripts/crontab/push/jpush.php
View file @
a2810dab
...
...
@@ -84,6 +84,15 @@ class cliOrderClose extends basecli
$addData
=
unserialize
(
$pushData
);
$push
->
addOneToClient
(
$addData
);
}
$goodsCommonService
=
\Business\Goods\GoodsCommonServiceModel
::
getInstance
();
$stores
=
$goodsCommonService
->
getAlertGoods
();
if
(
!
empty
(
$stores
)){
foreach
(
$stores
as
$store
){
$addData
=
array
(
'storeId'
=>
$store
[
'storeId'
],
'type'
=>
\Our\ApiConst
::
messageGoodsAlert
,
'op'
=>
\Our\NameConst
::
set
,
'num'
=>
$store
[
'count'
],
'params'
=>
array
());
$push
->
addOneToClient
(
$addData
);
}
}
$push
->
sendTcpMessage
();
$redis
->
close
();
}
...
...
@@ -125,6 +134,7 @@ class cliOrderClose extends basecli
echo
date
(
'Y-m-d H:i:s'
,
TIMESTAMP
)
.
'客户端消息推送成功'
.
"
\r\n
"
;
}
}
...
...
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