...
|
...
|
@@ -2,7 +2,9 @@ |
|
|
|
|
|
namespace app\api\controller\reservoir;
|
|
|
|
|
|
use app\api\controller\v8\User;
|
|
|
use app\common\controller\Api;
|
|
|
use app\common\helper\HttpHelper;
|
|
|
use fast\Tree;
|
|
|
use think\Request;
|
|
|
use think\Db;
|
...
|
...
|
@@ -16,6 +18,7 @@ class Index extends Api |
|
|
protected $model = '';
|
|
|
protected $noNeedLogin = ['list','reservoirinfo', 'playscore','getReiverorList', 'latest', 'latests', 'abnormal', 'latestdam', 'water_equipment'];
|
|
|
protected $noNeedRight = '*';
|
|
|
protected $sxjApiurl="http://124.71.107.128:9040/";
|
|
|
|
|
|
public function _initialize()
|
|
|
{
|
...
|
...
|
@@ -275,37 +278,15 @@ class Index extends Api |
|
|
// 水库列表
|
|
|
public function list()
|
|
|
{
|
|
|
//查询当前用户所属部门id
|
|
|
$id = $this->auth->id;
|
|
|
$depart_id = Db::name("inspection_staff")->where("user_id", $id)->value("depart_id");
|
|
|
|
|
|
if (!empty($depart_id)) {
|
|
|
//获取下级所有子部门ID
|
|
|
$tree = Tree::instance();
|
|
|
$departModel = new \app\admin\model\inspection\Depart();
|
|
|
$tree->init(collection($departModel->order('weigh asc,id asc')->select())->toArray(), 'pid');
|
|
|
$depart_ids = $tree->getChildrenIds($depart_id, true);
|
|
|
}
|
|
|
|
|
|
$where = [];
|
|
|
if (!empty($depart_ids)) {
|
|
|
$where["inspection_depart_id"] = ["IN", $depart_ids];
|
|
|
}
|
|
|
|
|
|
$list = $this->model
|
|
|
->field('id,name,thumbnail_images,completetime,user_name,address')
|
|
|
->where($where)
|
|
|
// ->where('county_id',1)
|
|
|
// ->where('reservoir_id',"in",[4,6,9])
|
|
|
->select();
|
|
|
if (!empty($list)) {
|
|
|
foreach ($list as $k => $v) {
|
|
|
$list[$k]['thumbnail_images'] = full_image_kevin($v['thumbnail_images']);
|
|
|
$list[$k]['completetime_text'] = date('Y年m月d日', $v['completetime']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->success('', $list);
|
|
|
$user=new User();
|
|
|
$token=$user->uimsApitoken();
|
|
|
$url=$this->sxjApiurl."data_api/v1/getWaterworksListData";
|
|
|
$res =HttpHelper::postheader($url,"","",$token);
|
|
|
$res=json_decode($res,true);
|
|
|
foreach ($res['data']['list'] as $k=>$v){
|
|
|
$res['data']['list'][$k]['thumbnail_images']="https://yysw_ynzhsk_cn/image_jg/work.png";
|
|
|
}
|
|
|
return $this->success($res['message'],$res['data']);
|
|
|
}
|
|
|
|
|
|
public function test()
|
...
|
...
|
|