DESKTOP-9JTA2JJ\HP 5 years ago
parent
commit
ca2d66d5ea
1 changed files with 8 additions and 1 deletions
  1. 8 1
      api/application/controllers/Project.php

+ 8 - 1
api/application/controllers/Project.php

@@ -91,7 +91,14 @@ class Project extends Base_Controller {
         // $where2['L.status'] = 1;
         // $res = $this->Lamp_model->get_list_by_multi_join($where2, 'count(*) as total',NULL, NULL, $join, NULL, NUll, 'L', true);
         // $data['lighting_count'] = $res['total'];
-        $data['timezone'] = ''; 
+        $timeData = $this->Global_location_model->get_one(['id'=>$data['cityid']],'timezone');
+        if ($timeData['timezone'] < 0) {
+            $timezone = substr('00'.abs($timeData['timezone']), -2).':00';
+            $data['timezone'] = 'UTC/GMT -'.$timezone;
+        }else{
+            $timezone = substr('00'.abs($timeData['timezone']), -2).':00';
+            $data['timezone'] = 'UTC/GMT +'.$timezone;
+        }
 
         if (empty($data['cityid'])) {
             $data['countryId'] = 0;