|
|
@@ -325,7 +325,7 @@ class GoodsService extends BaseService
|
|
|
* @param $params 参数
|
|
|
* @return array|false
|
|
|
*/
|
|
|
- public function updateGoodsCategory($pageSize = 100, $params = [])
|
|
|
+ public function updateGoodsCategory($pageSize = 200, $params = [])
|
|
|
{
|
|
|
set_time_limit(0);
|
|
|
$cacheKey = "caches:supply:goods_category_update_{$pageSize}";
|
|
|
@@ -334,11 +334,9 @@ class GoodsService extends BaseService
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- $page = RedisService::get($cacheKey . '_page');
|
|
|
- $page = $page ? $page + 1 : 1;
|
|
|
$params = [
|
|
|
'limit' => $pageSize > 0 ? $pageSize : 50,
|
|
|
- 'page' => $page,
|
|
|
+ 'page' => 1,
|
|
|
'pid' => isset($params['pid']) ? $params['pid'] : 0, // 上级ID
|
|
|
];
|
|
|
$categorys = [];
|
|
|
@@ -361,12 +359,9 @@ class GoodsService extends BaseService
|
|
|
}
|
|
|
}
|
|
|
unset($item);
|
|
|
- } else {
|
|
|
- RedisService::set($cacheKey . '_page', 0, rand(300, 600));
|
|
|
}
|
|
|
|
|
|
if ($categorys) {
|
|
|
- RedisService::set($cacheKey . '_page', $page, rand(300, 600));
|
|
|
RedisService::set($cacheKey, $categorys, rand(5, 10));
|
|
|
GoodsCategoryModel::insert($categorys);
|
|
|
}
|