wupengfei 2 years ago
parent
commit
bfe323e7b8
4 changed files with 73 additions and 44 deletions
  1. 3 1
      .idea/workspace.xml
  2. 0 39
      application/api/common.php
  3. 31 4
      application/api/controller/Qc.php
  4. 39 0
      application/common.php

+ 3 - 1
.idea/workspace.xml

@@ -3,7 +3,9 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/common.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/common.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Qc.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Qc.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -213,7 +215,7 @@
       <workItem from="1663721089544" duration="18248000" />
       <workItem from="1663807609347" duration="18144000" />
       <workItem from="1663893231881" duration="18711000" />
-      <workItem from="1664152288609" duration="21251000" />
+      <workItem from="1664152288609" duration="21335000" />
     </task>
     <servers />
   </component>

+ 0 - 39
application/api/common.php

@@ -1,45 +1,6 @@
 <?php
 // 接口公共方法
 use think\Db;
-use JPush\Client;
-require_once env('root_path').'vendor/jpush/jpush/autoload.php';
-
-function Jpush($user_id = 0,$alert = ''){
-    $appKey = '02a7faefd91c8a6a446a6a14';
-    $masterSecret = 'ba2e100db997024d9b6e5d35';
-    $client = new Client($appKey, $masterSecret,null);
-    $push_payload = $client->push()
-        ->setPlatform(array('ios', 'android'))
-        ->addAlias(strval($user_id))
-        ->iosNotification($alert, array(
-            'badge' => '+1',
-            'content-available' => true,
-            'mutable-content' => true,
-            'category' => 'jiguang',
-            'extras' => array(
-                'key' => 'value',
-                'jiguang'
-            ),
-        ))->androidNotification($alert, array(
-            'title' => '消息通知',
-            // 'builder_id' => 2,
-            'extras' => array(
-                'key' => 'value',
-                'jiguang'
-            ),
-        ))->options(array(
-            'apns_production' => True,
-        ));
-    try {
-        $response = $push_payload->send();
-        return $response;
-    } catch  (\JPush\Exceptions\APIConnectionException $e) {
-        return $e;
-    } catch (\JPush\Exceptions\APIRequestException $e) {
-        return $e;
-    }
-}
-
 
 function get_order_sn(){
     $order_id_main = date('YmdHis') . rand(10000000,99999999);

+ 31 - 4
application/api/controller/Qc.php

@@ -1,7 +1,34 @@
 <?php
 
 namespace app\api\controller;
-
+use app\common\model\ChinaArea;
+use app\common\model\GoodsOrder;
+use app\common\model\LevelOrder as LOM;
+use app\common\model\StoreGoods;
+use app\common\model\User;
+use app\common\model\UserMessage;
+use app\common\model\UserWallet;
+use app\common\model\VideoIntro;
+use app\common\service\Activity;
+use app\common\service\OrderCallback;
+use app\order\controller\StoreOrder;
+use EasyWeChat\MiniProgram\Application;
+use library\tools\Data;
+use MongoDB\Driver\Server;
+use Qiniu\Auth;
+use Qiniu\Storage\UploadManager;
+use think\Exception;
+use think\Session;
+use think\cache\driver\Redis;
+use EasyWeChat\Factory;
+use Firebase\JWT\JWT;
+use think\Db;
+use AlibabaCloud\Client\AlibabaCloud;
+use AlibabaCloud\Client\Exception\ClientException;
+use AlibabaCloud\Client\Exception\ServerException;
+use function AlibabaCloud\Client\value;
+use function EasyWeChat\Kernel\data_get;
+use function Stringy\create;
 
 use JPush\Client;
 //$path =  __DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
@@ -12,9 +39,9 @@ class Qc extends Base {
 
     public function index()
     {
-        //$re = Jpush(22,'fdssdf');
-       // var_dump($re);
-       // die();
+        $re = Jpush(22,'fdssdf');
+        var_dump($re);
+        die();
         $user_id = 22 ;
         $alert ='aaaa';
         if(empty($user_id)) return false;

+ 39 - 0
application/common.php

@@ -1,5 +1,44 @@
 <?php
 use think\Db;
+use JPush\Client;
+require_once env('root_path').'vendor/jpush/jpush/autoload.php';
+
+function Jpush($user_id = 0,$alert = ''){
+    $appKey = '02a7faefd91c8a6a446a6a14';
+    $masterSecret = 'ba2e100db997024d9b6e5d35';
+    $client = new Client($appKey, $masterSecret,null);
+    $push_payload = $client->push()
+        ->setPlatform(array('ios', 'android'))
+        ->addAlias(strval($user_id))
+        ->iosNotification($alert, array(
+            'badge' => '+1',
+            'content-available' => true,
+            'mutable-content' => true,
+            'category' => 'jiguang',
+            'extras' => array(
+                'key' => 'value',
+                'jiguang'
+            ),
+        ))->androidNotification($alert, array(
+            'title' => '消息通知',
+            // 'builder_id' => 2,
+            'extras' => array(
+                'key' => 'value',
+                'jiguang'
+            ),
+        ))->options(array(
+            'apns_production' => True,
+        ));
+    try {
+        $response = $push_payload->send();
+        return $response;
+    } catch  (\JPush\Exceptions\APIConnectionException $e) {
+        return $e;
+    } catch (\JPush\Exceptions\APIRequestException $e) {
+        return $e;
+    }
+}
+
 /**
  * 秒转换为天
  */