mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
获取城市数据完整列表加入缓存
This commit is contained in:
parent
e290ad38ae
commit
d6db8fabdd
@ -133,8 +133,9 @@ class SystemCity extends AuthController
|
||||
*/
|
||||
public function clean_cache()
|
||||
{
|
||||
$res = CacheService::delete('CITY_LIST');
|
||||
if ($res) {
|
||||
$res1 = CacheService::delete('CITY_LIST');
|
||||
$res2 = CacheService::delete('CITY_FULL_LIST');
|
||||
if ($res1 && $res2) {
|
||||
return app('json')->success(400185);
|
||||
} else {
|
||||
return app('json')->fail(400186);
|
||||
|
||||
@ -28,7 +28,6 @@ use crmeb\services\FormBuilder as Form;
|
||||
* @method update($id, array $data, ?string $key = null) 修改数据
|
||||
* @method value(array $where, ?string $field = '') 获取一条数据
|
||||
* @method getShippingCity() 获取运费模板城市数据
|
||||
* @method fullList(?$field = '') 获取城市数据完整列表
|
||||
*/
|
||||
class SystemCityServices extends BaseServices
|
||||
{
|
||||
@ -153,4 +152,14 @@ class SystemCityServices extends BaseServices
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取城市数据
|
||||
* @return mixed
|
||||
*/
|
||||
public function fullList($field = '*')
|
||||
{
|
||||
return CacheService::remember('CITY_FULL_LIST', function () use ($field) {
|
||||
return $this->dao->fullList($field);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user