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
865dadc7
Commit
865dadc7
authored
Dec 25, 2018
by
chenchuanwen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into ccw
parents
a9c78a18
7f132f3b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
24 deletions
+36
-24
Cart.php
application/controllers/Cart.php
+1
-1
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+4
-4
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+31
-19
No files found.
application/controllers/Cart.php
View file @
865dadc7
...
@@ -161,7 +161,7 @@ class CartController extends \Our\Controller_AbstractApi{
...
@@ -161,7 +161,7 @@ class CartController extends \Our\Controller_AbstractApi{
$sess
=
\Yaf\Session
::
getInstance
();
$sess
=
\Yaf\Session
::
getInstance
();
$currentAddress
=
$sess
->
get
(
'currentAddress'
);
$currentAddress
=
$sess
->
get
(
'currentAddress'
);
$result
=
$cartService
->
addOrder
(
$data
,
$this
->
memberId
,
$currentAddress
);
$result
=
$cartService
->
addOrder
(
$data
,
$this
->
memberId
,
$currentAddress
);
$this
->
success
(
$result
);
$this
->
success
(
$result
);
}
}
...
...
application/library/Order/OrderConfirmUtil.php
View file @
865dadc7
...
@@ -145,10 +145,10 @@ class OrderConfirmUtil {
...
@@ -145,10 +145,10 @@ class OrderConfirmUtil {
$cartList
=
$pBundlingService
->
getFormatCartListForOrder
(
$storeCartList
,
$this
->
memberId
,
true
,
$dbName
);
$cartList
=
$pBundlingService
->
getFormatCartListForOrder
(
$storeCartList
,
$this
->
memberId
,
true
,
$dbName
);
$gcIds
=
isset
(
$cartList
[
'gcIds'
])
?
$cartList
[
'gcIds'
]
:
array
();
$gcIds
=
isset
(
$cartList
[
'gcIds'
])
?
$cartList
[
'gcIds'
]
:
array
();
$storeCartData
=
array
(
'cartList'
=>
$cartList
[
'list'
],
'storeIds'
=>
array_keys
(
$cartList
[
'list'
]),
'goodsIds'
=>
$storeCartList
[
'goodsIds'
],
'goodsCommonIds'
=>
$storeCartList
[
'goodsCommonIds'
],
'blIds'
=>
$storeCartList
[
'blIds'
],
'gcIds'
=>
$gcIds
);
$storeCartData
=
array
(
'cartList'
=>
$cartList
[
'list'
],
'storeIds'
=>
array_keys
(
$cartList
[
'list'
]),
'goodsIds'
=>
$storeCartList
[
'goodsIds'
],
'goodsCommonIds'
=>
$storeCartList
[
'goodsCommonIds'
],
'blIds'
=>
$storeCartList
[
'blIds'
],
'gcIds'
=>
$gcIds
);
}
}
if
(
$this
->
storeCouponIds
&&
$this
->
couponIds
)
{
if
(
$this
->
storeCouponIds
&&
$this
->
couponIds
)
{
$storeCartData
=
$this
->
checkCouponForOrder
(
$storeCartData
,
$this
->
memberId
);
$storeCartData
=
$this
->
checkCouponForOrder
(
$storeCartData
,
$this
->
memberId
);
}
}
return
$storeCartData
;
return
$storeCartData
;
...
@@ -1259,4 +1259,4 @@ class OrderConfirmUtil {
...
@@ -1259,4 +1259,4 @@ class OrderConfirmUtil {
return
self
::
$_instance
;
return
self
::
$_instance
;
}
}
}
}
\ No newline at end of file
application/models/Business/Goods/GoodsCommonService.php
View file @
865dadc7
...
@@ -319,32 +319,37 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -319,32 +319,37 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$endTime
=
TIMESTAMP
;
$endTime
=
TIMESTAMP
;
$where
=
'goods_edittime > '
.
$beginTime
.
' and goods_edittime<='
.
$endTime
.
' and goods_id in (select sg.goods_id from han_stat_goods sg)'
;
$where
=
'goods_edittime > '
.
$beginTime
.
' and goods_edittime<='
.
$endTime
.
' and goods_id in (select sg.goods_id from han_stat_goods sg)'
;
$field
=
'goods_id,is_del,goods_name,goods_storage,goods_price,store_id'
;
$field
=
'goods_id,
goods_commonid,
is_del,goods_name,goods_storage,goods_price,store_id'
;
$result
=
true
;
$result
=
true
;
$goodsDao
=
\DAO\GoodsModel
::
getInstance
();
$goodsDao
=
\DAO\GoodsModel
::
getInstance
();
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$statGoodsDao
=
\DAO\StatGoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$statGoodsDao
=
\DAO\StatGoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$store_tmp
=
array
();
$store_tmp
=
array
();
if
(
$datas
=
$goodsDao
->
getList
(
$where
,
$field
))
{
//更新商品报表
$count
=
$statGoodsDao
->
getCountByWhere
(
'1=1'
);
echo
'in:'
.
count
(
$datas
);
if
(
$count
>
0
)
{
foreach
(
$datas
as
$key
=>
$val
)
{
if
(
$datas
=
$goodsDao
->
getList
(
$where
,
$field
))
{
//更新商品报表
if
(
isset
(
$store_tmp
[
$val
[
'store_id'
]]))
{
echo
'in:'
.
count
(
$datas
);
$store_info
=
$store_tmp
[
$val
[
'store_id'
]];
foreach
(
$datas
as
$key
=>
$val
)
{
}
else
{
if
(
isset
(
$store_tmp
[
$val
[
'store_id'
]]))
{
$store_info
=
$storeDao
->
getFieldsInfo
(
array
(
'store_id'
=>
$val
[
'store_id'
]),
'province_id, city_id, area_id'
);
$store_info
=
$store_tmp
[
$val
[
'store_id'
]];
}
}
else
{
$update_stat_goods
=
$val
;
$store_info
=
$storeDao
->
getFieldsInfo
(
array
(
'store_id'
=>
$val
[
'store_id'
]),
'province_id, city_id, area_id'
);
$update_stat_goods
[
'upd_time'
]
=
$endTime
;
}
$update_stat_goods
[
'province_id'
]
=
$store_info
[
'province_id'
];
$update_stat_goods
=
$val
;
$update_stat_goods
[
'city_id'
]
=
$store_info
[
'city_id'
];
$update_stat_goods
[
'upd_time'
]
=
$endTime
;
$update_stat_goods
[
'area_id'
]
=
$store_info
[
'area_id'
];
$update_stat_goods
[
'province_id'
]
=
$store_info
[
'province_id'
];
unset
(
$update_stat_goods
[
'goods_id'
]);
$update_stat_goods
[
'city_id'
]
=
$store_info
[
'city_id'
];
$where
=
'goods_id='
.
$val
[
'goods_id'
]
.
' and upd_time <'
.
$beginTime
;
$update_stat_goods
[
'area_id'
]
=
$store_info
[
'area_id'
];
if
(
!
$statGoodsDao
->
update
(
$where
,
$update_stat_goods
)){
unset
(
$update_stat_goods
[
'goods_id'
]);
$result
=
false
;
$where
=
'goods_id='
.
$val
[
'goods_id'
]
.
' and upd_time <'
.
$beginTime
;
if
(
!
$statGoodsDao
->
update
(
$where
,
$update_stat_goods
)){
$result
=
false
;
}
}
}
}
}
}
else
{
file_put_contents
(
$this
->
baseDir
.
\Our\PathConst
::
goodsSellStatTime
,
'0'
);
}
}
$where
=
'goods_id not in (select sg.goods_id from han_stat_goods sg)'
;
$where
=
'goods_id not in (select sg.goods_id from han_stat_goods sg)'
;
...
@@ -368,9 +373,13 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -368,9 +373,13 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
}
}
}
}
echo
"
\n
"
;
if
(
$result
)
{
//商品报表更新成功
if
(
$result
)
{
//商品报表更新成功
file_put_contents
(
$this
->
baseDir
.
\Our\PathConst
::
goodsStatTime
,
$endTime
);
file_put_contents
(
$this
->
baseDir
.
\Our\PathConst
::
goodsStatTime
,
$endTime
);
echo
"upd goods succ"
;
}
else
{
echo
"upd goods fail"
;
}
}
return
$result
;
return
$result
;
}
}
...
@@ -382,7 +391,6 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -382,7 +391,6 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
* Time: 下午 6:19
* Time: 下午 6:19
*/
*/
public
function
updateStatGoodsSell
(){
public
function
updateStatGoodsSell
(){
file_put_contents
(
$this
->
baseDir
.
\Our\PathConst
::
goodsSellStatTime
,
''
);
$beginTime
=
file_get_contents
(
$this
->
baseDir
.
\Our\PathConst
::
goodsSellStatTime
,
TIMESTAMP
);
$beginTime
=
file_get_contents
(
$this
->
baseDir
.
\Our\PathConst
::
goodsSellStatTime
,
TIMESTAMP
);
$beginTime
=
$beginTime
?
$beginTime
:
ApiConst
::
zero
;
$beginTime
=
$beginTime
?
$beginTime
:
ApiConst
::
zero
;
$endTime
=
TIMESTAMP
;
$endTime
=
TIMESTAMP
;
...
@@ -419,8 +427,12 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -419,8 +427,12 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
}
}
if
(
!
$result
)
{
if
(
!
$result
)
{
echo
"
\n
"
;
echo
'upd sell fail'
;
$statGoodsDao
->
db
->
doRollback
();
$statGoodsDao
->
db
->
doRollback
();
}
else
{
//商品报表更新成功
}
else
{
//商品报表更新成功
echo
"
\n
"
;
echo
'upd sell succ'
;
$statGoodsDao
->
db
->
doCommit
();
$statGoodsDao
->
db
->
doCommit
();
file_put_contents
(
$this
->
baseDir
.
\Our\PathConst
::
goodsSellStatTime
,
$endTime
);
file_put_contents
(
$this
->
baseDir
.
\Our\PathConst
::
goodsSellStatTime
,
$endTime
);
}
}
...
...
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