|
@@ -115,36 +115,38 @@ class Project extends Base_Controller {
|
|
|
$data['longitude'] = $res1['longitude'];
|
|
|
$data['latitude'] = $res1['latitude'];
|
|
|
$res2 = $this->Global_location_model->get_one(['id'=>$res1['pid']],'pid,chinese_name,english_name');
|
|
|
- if ($res1['level'] == 4) {
|
|
|
+ $data['city'] = $res2['english_name'];
|
|
|
+ // if ($res1['level'] == 4) {
|
|
|
$data['areaId'] = $data['cityid'];
|
|
|
$data['cityId'] = $res1['pid'];
|
|
|
$data['provinceId'] = $res2['pid'];
|
|
|
$res3 = $this->Global_location_model->get_one(['id'=>$res2['pid']],'pid,chinese_name,english_name');
|
|
|
+ $data['province'] = $res3['english_name'];
|
|
|
$data['countryId'] = $res3['pid'];
|
|
|
$location_ch = $res3['chinese_name'].','.$res2['chinese_name'].','.$res1['chinese_name'];
|
|
|
$location_en = $res1['english_name'].','.$res2['english_name'].','.$res3['english_name'];
|
|
|
- }elseif ($res1['level'] == 3) {
|
|
|
- $data['areaId'] = 0;
|
|
|
- $data['cityId'] = $data['cityid'];
|
|
|
- $data['provinceId'] = $res1['pid'];
|
|
|
- $data['countryId'] = $res2['pid'];
|
|
|
- $location_ch = $res2['chinese_name'].','.$res1['chinese_name'];
|
|
|
- $location_en = $res1['english_name'].','.$res2['english_name'];
|
|
|
- }elseif ($res1['level'] == 2) {
|
|
|
- $data['areaId'] = 0;
|
|
|
- $data['cityId'] = 0;
|
|
|
- $data['provinceId'] = $data['cityid'];
|
|
|
- $data['countryId'] = $res1['pid'];
|
|
|
- $location_ch = $res1['chinese_name'];
|
|
|
- $location_en = $res1['english_name'];
|
|
|
- }else{
|
|
|
- $data['areaId'] = 0;
|
|
|
- $data['cityId'] = 0;
|
|
|
- $data['provinceId'] = 0;
|
|
|
- $data['countryId'] = $data['cityid'];
|
|
|
- $location_ch = $res1['chinese_name'];
|
|
|
- $location_en = $res1['english_name'];
|
|
|
- }
|
|
|
+ // }elseif ($res1['level'] == 3) {
|
|
|
+ // $data['areaId'] = 0;
|
|
|
+ // $data['cityId'] = $data['cityid'];
|
|
|
+ // $data['provinceId'] = $res1['pid'];
|
|
|
+ // $data['countryId'] = $res2['pid'];
|
|
|
+ // $location_ch = $res2['chinese_name'].','.$res1['chinese_name'];
|
|
|
+ // $location_en = $res1['english_name'].','.$res2['english_name'];
|
|
|
+ // }elseif ($res1['level'] == 2) {
|
|
|
+ // $data['areaId'] = 0;
|
|
|
+ // $data['cityId'] = 0;
|
|
|
+ // $data['provinceId'] = $data['cityid'];
|
|
|
+ // $data['countryId'] = $res1['pid'];
|
|
|
+ // $location_ch = $res1['chinese_name'];
|
|
|
+ // $location_en = $res1['english_name'];
|
|
|
+ // }else{
|
|
|
+ // $data['areaId'] = 0;
|
|
|
+ // $data['cityId'] = 0;
|
|
|
+ // $data['provinceId'] = 0;
|
|
|
+ // $data['countryId'] = $data['cityid'];
|
|
|
+ // $location_ch = $res1['chinese_name'];
|
|
|
+ // $location_en = $res1['english_name'];
|
|
|
+ // }
|
|
|
$data['location'] = $location_en;
|
|
|
$project_weather = $this->db->query('select * from project_weather where projectId = '.$project_id)->row_array();
|
|
|
if (empty($project_weather) || time() - strtotime($project_weather['updatetime']) > 3600) {
|
|
@@ -573,39 +575,42 @@ class Project extends Base_Controller {
|
|
|
$location_en = 'There is no location information, please select location information on the edit project page.';
|
|
|
}else{
|
|
|
$res1 = $this->Global_location_model->get_one(['id'=>$data['cityid']],'level,pid,chinese_name,longitude,latitude,english_name');
|
|
|
+ $data['area'] = $res1['english_name'];
|
|
|
$data['longitude'] = $res1['longitude'];
|
|
|
$data['latitude'] = $res1['latitude'];
|
|
|
$res2 = $this->Global_location_model->get_one(['id'=>$res1['pid']],'pid,chinese_name,english_name');
|
|
|
- if ($res1['level'] == 4) {
|
|
|
+ $data['city'] = $res2['english_name'];
|
|
|
+ // if ($res1['level'] == 4) {
|
|
|
$data['areaId'] = $data['cityid'];
|
|
|
$data['cityId'] = $res1['pid'];
|
|
|
$data['provinceId'] = $res2['pid'];
|
|
|
$res3 = $this->Global_location_model->get_one(['id'=>$res2['pid']],'pid,chinese_name,english_name');
|
|
|
+ $data['province'] = $res3['english_name'];
|
|
|
$data['countryId'] = $res3['pid'];
|
|
|
$location_ch = $res3['chinese_name'].','.$res2['chinese_name'].','.$res1['chinese_name'];
|
|
|
$location_en = $res1['english_name'].','.$res2['english_name'].','.$res3['english_name'];
|
|
|
- }elseif ($res1['level'] == 3) {
|
|
|
- $data['areaId'] = 0;
|
|
|
- $data['cityId'] = $data['cityid'];
|
|
|
- $data['provinceId'] = $res1['pid'];
|
|
|
- $data['countryId'] = $res2['pid'];
|
|
|
- $location_ch = $res2['chinese_name'].','.$res1['chinese_name'];
|
|
|
- $location_en = $res1['english_name'].','.$res2['english_name'];
|
|
|
- }elseif ($res1['level'] == 2) {
|
|
|
- $data['areaId'] = 0;
|
|
|
- $data['cityId'] = 0;
|
|
|
- $data['provinceId'] = $data['cityid'];
|
|
|
- $data['countryId'] = $res1['pid'];
|
|
|
- $location_ch = $res1['chinese_name'];
|
|
|
- $location_en = $res1['english_name'];
|
|
|
- }else{
|
|
|
- $data['areaId'] = 0;
|
|
|
- $data['cityId'] = 0;
|
|
|
- $data['provinceId'] = 0;
|
|
|
- $data['countryId'] = $data['cityid'];
|
|
|
- $location_ch = $res1['chinese_name'];
|
|
|
- $location_en = $res1['english_name'];
|
|
|
- }
|
|
|
+ // }elseif ($res1['level'] == 3) {
|
|
|
+ // $data['areaId'] = 0;
|
|
|
+ // $data['cityId'] = $data['cityid'];
|
|
|
+ // $data['provinceId'] = $res1['pid'];
|
|
|
+ // $data['countryId'] = $res2['pid'];
|
|
|
+ // $location_ch = $res2['chinese_name'].','.$res1['chinese_name'];
|
|
|
+ // $location_en = $res1['english_name'].','.$res2['english_name'];
|
|
|
+ // }elseif ($res1['level'] == 2) {
|
|
|
+ // $data['areaId'] = 0;
|
|
|
+ // $data['cityId'] = 0;
|
|
|
+ // $data['provinceId'] = $data['cityid'];
|
|
|
+ // $data['countryId'] = $res1['pid'];
|
|
|
+ // $location_ch = $res1['chinese_name'];
|
|
|
+ // $location_en = $res1['english_name'];
|
|
|
+ // }else{
|
|
|
+ // $data['areaId'] = 0;
|
|
|
+ // $data['cityId'] = 0;
|
|
|
+ // $data['provinceId'] = 0;
|
|
|
+ // $data['countryId'] = $data['cityid'];
|
|
|
+ // $location_ch = $res1['chinese_name'];
|
|
|
+ // $location_en = $res1['english_name'];
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
$data['location'] = $location_en;
|