|
@@ -880,6 +880,10 @@ class Lampcontrol extends Base_Controller {
|
|
|
$protocoltype = $this->input->post('protocoltype',true);
|
|
|
$data['protocoltype'] = $protocoltype;
|
|
|
|
|
|
+ $data['model'] = intval($this->input->post('model',true));
|
|
|
+ $data['power'] = intval($this->input->post('power',true));
|
|
|
+
|
|
|
+
|
|
|
$loadtype = $this->input->post('loadtype',true);
|
|
|
if ($loadtype !== null) {
|
|
|
$data["loadtype"] = intval($loadtype);
|
|
@@ -915,6 +919,13 @@ class Lampcontrol extends Base_Controller {
|
|
|
if ($this->Lamp_model->getDataCount(array('number'=>$data['number'], 'projectid'=>$data['projectid'])) > 0) {
|
|
|
exit(json_result('0401', $this->response['0401'], array()));
|
|
|
}
|
|
|
+ $fascal_year = $this->input->post('fascal_year',true);
|
|
|
+ if (empty($fascal_year)) $fascal_year = date('Y-m-d');
|
|
|
+ $data['fascal_year'] = $fascal_year;
|
|
|
+
|
|
|
+ $fascal_year_phase = $this->input->post('fascal_year_phase',true);
|
|
|
+ if (empty($fascal_year_phase)) $fascal_year_phase = date('Y');
|
|
|
+ $data['fascal_year_phase'] = $fascal_year_phase.'-'.date('Y',strtotime($fascal_year_phase.' +1 year'));
|
|
|
|
|
|
$lamp = $this->Lamp_model->get_one(array('address'=>$data['address']),'projectid,number');
|
|
|
if (!empty($lamp)) {
|
|
@@ -933,8 +944,8 @@ class Lampcontrol extends Base_Controller {
|
|
|
$data['longitude'] = $globalData['longitude'];
|
|
|
$data['latitude'] = $globalData['latitude'];
|
|
|
}
|
|
|
-
|
|
|
- $data['createtime'] = date('Y-m-d H:i:s',time());
|
|
|
+ $createtime = $this->input->post('createtime',true);
|
|
|
+ $data['createtime'] = empty($createtime) ? date('Y-m-d H:i:s',time()) : $createtime;
|
|
|
|
|
|
$lampid = $this->Lamp_model->add($data);
|
|
|
|
|
@@ -949,6 +960,12 @@ class Lampcontrol extends Base_Controller {
|
|
|
exit(json_result('0401', $this->response['0401'], array()));
|
|
|
}
|
|
|
|
|
|
+ $fascal_year = $this->input->post('fascal_year',true);
|
|
|
+ if (!empty($fascal_year)) $data['fascal_year'] = $fascal_year;
|
|
|
+
|
|
|
+ $fascal_year_phase = $this->input->post('fascal_year_phase',true);
|
|
|
+ if (!empty($fascal_year_phase)) $data['fascal_year_phase'] = $fascal_year_phase;
|
|
|
+
|
|
|
$lamp = $this->Lamp_model->get_one(array('address'=>$data['address'], 'id !='=>$where['id']),'projectid,number');
|
|
|
if (!empty($lamp)) {
|
|
|
$projectid = $lamp['projectid'];
|