接口修改2
This commit is contained in:
parent
768afd684a
commit
79fe751dde
@ -116,10 +116,12 @@ class Notice extends BaseController
|
|||||||
// 验证失败 输出错误信息
|
// 验证失败 输出错误信息
|
||||||
return to_assign(1, $e->getError());
|
return to_assign(1, $e->getError());
|
||||||
}
|
}
|
||||||
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
|
if($this->adminInfo['position_id'] != 1) { //不是超级管理员
|
||||||
$param['area_id']=$adds['area_id'];
|
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
|
||||||
$param['street_id']=$adds['street_id'];
|
$param['area_id']=$adds['area_id'];
|
||||||
$param['village_id']=$adds['village_id'];
|
$param['street_id']=$adds['street_id'];
|
||||||
|
$param['village_id']=$adds['village_id'];
|
||||||
|
}
|
||||||
|
|
||||||
$this->model->addNotice($param);
|
$this->model->addNotice($param);
|
||||||
}else{
|
}else{
|
||||||
@ -188,8 +190,7 @@ class Notice extends BaseController
|
|||||||
{
|
{
|
||||||
$param = get_params();
|
$param = get_params();
|
||||||
$id = isset($param['id']) ? $param['id'] : 0;
|
$id = isset($param['id']) ? $param['id'] : 0;
|
||||||
$type = isset($param['type']) ? $param['type'] : 0;
|
|
||||||
|
|
||||||
$this->model->delNoticeById($id,$type);
|
$this->model->delNoticeById($id,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use app\api\BaseController;
|
use app\api\BaseController;
|
||||||
|
use think\facade\Cache;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1221,5 +1222,40 @@ class Statistics extends BaseController
|
|||||||
$this->apiSuccess('获取成功',$return);
|
$this->apiSuccess('获取成功',$return);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取天气
|
||||||
|
public function get_weather(){
|
||||||
|
// 获取天气
|
||||||
|
// 101271007 纳溪 510503
|
||||||
|
// 101271002 江阳区 510502
|
||||||
|
// 101271008 龙马潭区 510504
|
||||||
|
// 101271003 泸县 510521
|
||||||
|
// 101271004 合江 510522
|
||||||
|
// 101271006 古蔺 510525
|
||||||
|
// 101271005 叙永 510524
|
||||||
|
// 判断区域
|
||||||
|
$name = '101271002';
|
||||||
|
|
||||||
|
$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;
|
||||||
|
}
|
||||||
|
$this->apiSuccess('获取成功', $news);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -142,6 +142,8 @@ class Userinfo extends BaseController
|
|||||||
$post['address_name'] = $area_name.$street_name.$village.$brigade_name;
|
$post['address_name'] = $area_name.$street_name.$village.$brigade_name;
|
||||||
|
|
||||||
// 更新用户表
|
// 更新用户表
|
||||||
|
$u_up['nickname'] = $post['name'];
|
||||||
|
Db::table('fa_user')->where($where)->update($u_up);
|
||||||
// $header = Request::header('x-Token');
|
// $header = Request::header('x-Token');
|
||||||
// if(isset($header['x-token']) && !empty($header['x-token'])){
|
// if(isset($header['x-token']) && !empty($header['x-token'])){
|
||||||
// $phone['mobile'] = $post['phone']??'';
|
// $phone['mobile'] = $post['phone']??'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user