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
b951d479
Commit
b951d479
authored
Dec 24, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upd
parent
b656e013
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+22
-17
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
b951d479
...
@@ -326,25 +326,30 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -326,25 +326,30 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$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)'
;
...
...
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