dev
parent
6b53b0625a
commit
2e5dc0a9ea
|
|
@ -16,7 +16,7 @@ class CityDataController extends Controller
|
|||
*/
|
||||
public function statistics()
|
||||
{
|
||||
$settings = Setting::where('slug', 'like', 'city_data_%')->get()->toArray();
|
||||
$settings = Setting::where('slug', 'like', 'city_data_%')->orderBy('created_at', 'asc')->get()->toArray();
|
||||
|
||||
return $this->json(array_map(function ($item) {
|
||||
$_value = json_decode($item['value']);
|
||||
|
|
@ -41,7 +41,12 @@ class CityDataController extends Controller
|
|||
'city_data_chart_lingye',
|
||||
'city_data_chart_activity'
|
||||
])){
|
||||
Setting::where('slug', $key)->update(['value'=>json_encode($value)]);
|
||||
if(!empty($value)){
|
||||
$value = json_encode($value);
|
||||
}else{
|
||||
$value = '{}';
|
||||
}
|
||||
Setting::where('slug', $key)->update(['value'=>$value]);
|
||||
}else{//更新全市基础数据
|
||||
if(Setting::where('slug', $key)->exists()){
|
||||
Setting::where('slug', $key)->update(['value->value'=>$value]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue