wupengfei 1 jaar geleden
bovenliggende
commit
5c9933642c
4 gewijzigde bestanden met toevoegingen van 78 en 6 verwijderingen
  1. 6 4
      .idea/workspace.xml
  2. 4 1
      application/api/controller/Qc.php
  3. 42 1
      application/common.php
  4. 26 0
      application/common/service/Activity.php

+ 6 - 4
.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/controller/Expedite.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Expedite.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" />
+      <change beforePath="$PROJECT_DIR$/application/common/service/Activity.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/service/Activity.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -333,7 +335,7 @@
       <workItem from="1685062670566" duration="19535000" />
       <workItem from="1685321847287" duration="22228000" />
       <workItem from="1685422918249" duration="13139000" />
-      <workItem from="1685494086685" duration="13035000" />
+      <workItem from="1685494086685" duration="16075000" />
     </task>
     <servers />
   </component>
@@ -463,10 +465,10 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="1410" y="539" key="#com.intellij.fileTypes.FileTypeChooser/0.0.2560.1400@0.0.2560.1400" timestamp="1684374232836" />
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1685339275379">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1685521882301">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1685339275379" />
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1685521882301" />
     <state x="420" y="147" width="1942" height="1088" key="DiffContextDialog" timestamp="1684827948998">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

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

@@ -23,7 +23,10 @@ class Qc extends Base {
     }
 
 
-
+    public function sendEmail()
+    {
+       $this->success(send_email('913856018@qq.com','AAAAAAAAAAAAAAAAA'));
+    }
 
 
 

+ 42 - 1
application/common.php

@@ -1,6 +1,10 @@
 <?php
-use think\Db;
 
+use AlibabaCloud\Client\Exception\ClientException;
+use AlibabaCloud\Client\Exception\ServerException;
+use app\common\model\User;
+use think\Db;
+use Dm\Request\V20151123 as Dm;
 /**
  * 秒转换为天
  */
@@ -425,3 +429,40 @@ function get_short_name($name)
 }
 
 
+//  邮箱发送
+function send_email($email,$content='',$alias = '活动提示')
+{
+    require_once env('root_path').'/vendor/aliyunmail/aliyun-php-sdk-core/Config.php';
+    $iClientProfile = \DefaultProfile::getProfile("cn-hangzhou", "LTAI5tJ5p12drZegeWVG33xZ", "82UWAiY5e5wH8tSkRvMtqVoGO0h8SB");
+    $client = new \DefaultAcsClient($iClientProfile);
+    $request = new Dm\SingleSendMailRequest();
+    $request->setAccountName("gyx@yzm.gyxqcdz.com");
+    $request->setFromAlias("[$alias]");
+    $request->setAddressType(1);
+    $request->setTagName("activity");
+    $request->setReplyToAddress("true");
+    $request->setToAddress($email);
+    $request->setSubject("$alias");
+    $html_body = $content;
+    $request->setHtmlBody($content);
+    try {
+        $send_res = $client->getAcsResponse($request);
+        $sms_data = array(
+            'phone'=>$email,
+            'code'=>'AAAAA',
+            'result'=>'OK'
+        );
+        Db::name('store_member_sms')->insert($sms_data);
+    } catch (ClientException  $e) {
+        return $e->getErrorMessage();
+        // print_r($e->getErrorCode());
+        // print_r($e->getErrorMessage());
+    } catch (ServerException  $e) {
+        return $e->getErrorMessage();
+        // print_r($e->getErrorCode());
+        // print_r($e->getErrorMessage());
+
+    }
+    return 1;
+}
+

+ 26 - 0
application/common/service/Activity.php

@@ -194,4 +194,30 @@ class Activity extends SerBase
     }
 
 
+
+
+    // 活动变更消息推送
+    public static function activityChange($act_id)
+    {
+        $where = [];
+        $where[]  = ['a.pay_state','=',1];
+        $where[]  = ['a.refund_state','=',0];
+        $where[]  = ['a.refund_state','=',0];
+        $list = ActivityApplyItem::field('i.id,i.apply_id,i.phone,i.email,i.user_id')
+            ->alias('i')->where()
+            ->leftJoin('ActivityApply a','i.apply_id = a.id')
+            ->leftJoin('StoreOrderRefund r','r.item_id = i.id')
+            ->select()->toArray();
+        foreach ($list as $item_info) {
+            $refund_info = StoreOrderRefund::getRefundInfo($item_info['apply_id'],$item_info['id'],1);
+            if(!empty($refund_info && in_array($refund_info['status'],[0,1,3,5])))continue;
+            // 短信推送
+            // 邮箱提示
+
+        }
+    }
+
+
+
+
 }