Browse Source

亿米广告日志和对外展示

lizhen_gitee 3 years ago
parent
commit
0ca72cf3ae
2 changed files with 20 additions and 1 deletions
  1. 11 1
      application/api/controller/Advert.php
  2. 9 0
      application/api/controller/User.php

+ 11 - 1
application/api/controller/Advert.php

@@ -3,6 +3,7 @@
 namespace app\api\controller;
 
 use app\common\controller\Api;
+use think\Db;
 /**
  * 小米平台的广告
  * https://api.e.mi.com/doc.html#/1.0.0-mdtag9b26f-omd/document-f0283649125f62138db43c6f5fc25686
@@ -12,6 +13,15 @@ class Advert extends Api
     protected $noNeedLogin = ['*'];
     protected $noNeedRight = ['*'];
 
+    public function index(){
+        $list = Db::name('yimi_advert')->order('id desc')->page($this->page,100)->select();
+        foreach($list as $key => &$val){
+            $val['createdate'] = date('Y-m-d H:i:s',$val['createtime']);
+            //dump($val);
+        }
+        dump($list);
+    }
+
     //异或加密,解密
     public function xor_enc($str,$key)
     {
@@ -38,7 +48,7 @@ class Advert extends Api
     }*/
 
     //APP 转化数据统计方案(即:APP 上报对接方案): 广告主上报激活数据,亿米平台搭建服务系统关联点击&下载数据和广告主提供的所有激活数据,将激活数据归因到对应广告。
-    public function index(){
+    public function indextest(){
         //http://trail.e.mi.com/global/log?appId={appid}&info={data}&conv_type={convType}&customer_id={customerId}
         $api_url      = 'http://trail.e.mi.com/global/log?';
         $api_url_test = 'http://trail.e.mi.com/global/test?';

+ 9 - 0
application/api/controller/User.php

@@ -982,6 +982,15 @@ class User extends Api
 
         $result = curl_get($request_url);
         //dump($result);
+        //日志
+        $log = [
+            'param' => $base_data,
+            'url'   => $request_url,
+            'result'=> $result,
+            'createtime' => time(),
+        ];
+        Db::name('yimi_advert')->insertGetId($log);
+
         return true;
     }