1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\admin\controller;
- use think\Controller;
- use think\Session;
- use think\Db;
- use think\Request;
- use think\Log;
- class Dataacceptance extends Controller
- {
- public function getData(){
- $Data=input('');
- if(is_array($Data)){
- $getDataJson= json_encode($Data,320);
- $getdata=json_decode($getDataJson,true);//转成数组
- }else{
- $getDataJson=$Data;
- $getdata=json_decode($getDataJson,true);//转成数组
- }
- $data17 = json_encode($getdata);
- Log::record('yangpu4G' . ':' . $data17);
- $t=time();
- $time=date("Y-m-d H:i:s", $t);
- $data['data']=$data17;
- $data['time']=$time;
- $insertRes = Db::name('a_data')->insertGetId($data);
- // $res=addDataInfo("INSERT INTO a_data (id,data,time) VALUES ('','".$Data."','".$time."')");
- // echo 1111;
- // exit();
- $returnInformation['code'] = 'OK';
- $returnInformation['msg'] = "操作成功";
- return json_encode($returnInformation);
- }
- }
|