|
@@ -18,6 +18,10 @@ class Test extends CI_Controller {
|
|
|
|
|
|
// 批量导入
|
|
// 批量导入
|
|
public function haha(){
|
|
public function haha(){
|
|
|
|
+ $info = '91 0100 00 a800010001 0c 11 3e80 3c8c 3908 3138 2f44 3390283c2ee0245403e8007800781e05a3412cec27101e010fc3';
|
|
|
|
+ $info = '91010000a8000100010c113e803c8c390831382f443390283c2ee0245403e8007800781e05a3412cec27101e010fc3';
|
|
|
|
+ var_dump(substr($info, 34,4));
|
|
|
|
+ var_dump(round(base_convert(substr($info, 34,4), 16, 10)/1000,1));die;
|
|
$indexArr = ['B'=>'b','C'=>'c'];
|
|
$indexArr = ['B'=>'b','C'=>'c'];
|
|
// 文件上传成功
|
|
// 文件上传成功
|
|
// $data = $this->upload->data();
|
|
// $data = $this->upload->data();
|
|
@@ -72,4 +76,15 @@ class Test extends CI_Controller {
|
|
// 批量写入数据
|
|
// 批量写入数据
|
|
return $data;
|
|
return $data;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public function update_project_count(){
|
|
|
|
+ $list = $this->db->query('select id from project')->result_array();
|
|
|
|
+
|
|
|
|
+ foreach ($list as $key => $value) {
|
|
|
|
+ $res = $this->db->query('select count(*) as total from lampinfo where projectid = '.$value['id'])->row_array();
|
|
|
|
+ $this->db->query('update project set lampcount = '.$res['total'].' where id = '.$value['id']);
|
|
|
|
+ }
|
|
|
|
+ var_dump('ok');
|
|
|
|
+ }
|
|
}
|
|
}
|