1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace app\admin\controller;
- use think\Controller;
- use think\Session;
- use think\Db;
- use think\Request;
- class Log extends Controller
- {
-
-
- public function index(){
- }
- //下发命令
- public function add(){
-
-
- }
- public function status(){
- }
- public function delete(){
-
- }
- public function OneNetCeShi(){
- // if ($this->request->isPost()) {
- $data = input('');
- /* $rand=rand(0,2);
- $header=["Content-Type:application/json"];
- //将数据分配给不同的服务
- $httpserver=["http://47.98.153.212:1101","http://47.98.153.212:1102","http://47.98.153.212:1103"];
- $server=$httpserver[$rand];
- //将数据随机转发到别的平台做处理
- $res=curltest($server,$data,$header);
- */
- $list = array();
- if (is_array($data)) {
- $list['data'] = json_encode($data, 320);
- $getdata = json_decode($list['data'], true);//转成数组
- } else {
- $list['data'] = $data;
- $getdata = json_decode($list['data'], true);//转成数组
- }
- // $list['data']=11;
- // $list['response'] = "111";
- //
- // $list['notifyType'] = $getdata["notifyType"];
- // $list['deviceId'] = $getdata["deviceId"];
- // $list['addtime'] = date('Y-m-d H:i:s');
- $res = Db::name('one_net_data')->insertGetId($list);//将推送的数据存入总表
- $returnInformation['code'] = 200;
- $returnInformation['msg'] = "操作成功";
- return json_encode($returnInformation);
- // }
- }
-
- }
|