更新错误

This commit is contained in:
mkm 2023-02-09 18:05:28 +08:00
parent c0e0b993de
commit 9c7864f594
2 changed files with 25 additions and 2 deletions

View File

@ -35,7 +35,7 @@
{if {:session('gougu_admin')['group_access']==1}
<select name="area_id" lay-filter="area_id" lay-verify="required">
{volist name='street' id='vo'}
<option value="{$vo.code}">{$vo.name}</option>
<option value="{$vo.code}" {if $address.area_id==$vo.code } selected {/if} >{$vo.name}</option>
{/volist}
</select>
{else /}
@ -205,7 +205,6 @@
tool.sideClose(1000);
}
}
data.field['area_id'] = "{$address.area_id}"
tool.post('{$url[5]}?id={$id}', data.field, callback);
return false;
});

View File

@ -173,15 +173,23 @@ class Village extends BaseController
$name = '101271005';
}
$url = "https://devapi.qweather.com/v7/weather/now?key=b3e94fa75aae4551b6a5db150b409261&location=".$name;
$url1 = "https://devapi.qweather.com/v7/indices/1d?key=b3e94fa75aae4551b6a5db150b409261&type=0&location=".$name;
$is_cun = Cache::store('redis')->get($name);
$is_cun1 = Cache::store('redis')->get($name.'-1');
if($is_cun){
$data = json_decode($is_cun,1);
$data1 = json_decode($is_cun1,1);
$news['weather'] = $data;
$news['weather_indices'] = $data1;
}else{
$data = file_get_contents("compress.zlib://".$url);
$data1 = file_get_contents("compress.zlib://".$url1);
Cache::store('redis')->set($name,$data,1800);
Cache::store('redis')->set($name.'-1',$data1,1800);
$data = json_decode($data,1);
$data1 = json_decode($data1,1);
$news['weather'] = $data;
$news['weather_indices'] = $data1;
}
// halt($data);die;
$news['people_num'] = Db::table('fa_szxc_information_useraddress')->where('village_id',$news['village_id'])->where('status',1)->count();
@ -347,15 +355,23 @@ class Village extends BaseController
$name = '101271005';
}
$url = "https://devapi.qweather.com/v7/weather/now?key=b3e94fa75aae4551b6a5db150b409261&location=".$name;
$url1 = "https://devapi.qweather.com/v7/indices/1d?key=b3e94fa75aae4551b6a5db150b409261&type=0&location=".$name;
$is_cun = Cache::store('redis')->get($name);
$is_cun1 = Cache::store('redis')->get($name.'-1');
if($is_cun){
$data = json_decode($is_cun,1);
$data1 = json_decode($is_cun1,1);
$news['weather'] = $data;
$news['weather_indices'] = $data1;
}else{
$data = file_get_contents("compress.zlib://".$url);
$data1 = file_get_contents("compress.zlib://".$url1);
Cache::store('redis')->set($name,$data,1800);
Cache::store('redis')->set($name.'-1',$data1,1800);
$data = json_decode($data,1);
$data1 = json_decode($data1,1);
$news['weather'] = $data;
$news['weather_indices'] = $data1;
}
// halt($data);die;
$news['people_num'] = Db::table('fa_szxc_information_useraddress')->where('village_id',$news['village_id'])->where('status',1)->count();
@ -418,15 +434,23 @@ class Village extends BaseController
$name = '101271005';
}
$url = "https://devapi.qweather.com/v7/weather/now?key=b3e94fa75aae4551b6a5db150b409261&location=".$name;
$url1 = "https://devapi.qweather.com/v7/indices/1d?key=b3e94fa75aae4551b6a5db150b409261&type=0&location=".$name;
$is_cun = Cache::store('redis')->get($name);
$is_cun1 = Cache::store('redis')->get($name.'-1');
if($is_cun){
$data = json_decode($is_cun,1);
$data1 = json_decode($is_cun1,1);
$news['weather'] = $data;
$news['weather_indices'] = $data1;
}else{
$data = file_get_contents("compress.zlib://".$url);
$data1 = file_get_contents("compress.zlib://".$url1);
Cache::store('redis')->set($name,$data,1800);
Cache::store('redis')->set($name.'-1',$data1,1800);
$data = json_decode($data,1);
$data1 = json_decode($data1,1);
$news['weather'] = $data;
$news['weather_indices'] = $data1;
}
// halt($data);die;
$news['people_num'] = Db::table('fa_szxc_information_useraddress')->where('village_id',$news['village_id'])->where('status',1)->count();