zxhxx 3 jaren geleden
bovenliggende
commit
39781e675c
2 gewijzigde bestanden met toevoegingen van 55 en 2 verwijderingen
  1. 1 2
      application/common/model/Article.php
  2. 54 0
      extend/liuniu/WechatTempleService.php

+ 1 - 2
application/common/model/Article.php

@@ -98,11 +98,10 @@ class Article extends Model
             $ids = get_all_categories(ArticleCategory::lst(['cid'=>$where['cid']]),$where['ifyid']);
             $xwhere['article_category_id'] =['in',$ids];
         }
-        if(isset($where['key']) && $where['key']!='') $xwhere['title|info']  = ['like',"%{$where['key']}%"];
+        if(isset($where['key']) && $where['key']!='') $xwhere['title|synopsis']  = ['like',"%{$where['key']}%"];
         $list = $model->where($xwhere)->order('sort desc,id desc')->page($where['page'],$where['limit'])->select();
         $count =  $model->where($xwhere)->count();
         return compact('count','list');
-
     }
 
 

+ 54 - 0
extend/liuniu/WechatTempleService.php

@@ -0,0 +1,54 @@
+<?php
+namespace liuniu;
+use app\admin\model\wechat\TemplateInfo;
+
+class WechatTempleService
+{
+    /**
+     * 主营行业:IT科技 互联网|电子商务
+     * 副营行业:IT科技 IT软件与服务
+     */
+
+    //培训提醒通知
+    const RAINING_REMINDER  = 'OPENTM412298968';
+
+    //服务续费提醒通知
+    const RENWAL_REINDER = 'TM202168523';
+
+    //订单会员通知
+    const BECOME_VIP  = 'OPENTM406048156';
+
+    //工单受理提醒
+    const WORK_STATUS = 'OPENTM417758252';
+
+    //报名成功通知
+    const  REGISTRATION_SUCCESS = 'OPENTM413131902';
+
+    //工单超时通知
+    const WORK_TIMEOUT = 'OPENTM418425938';
+
+    //申请拒绝通知
+    const REQUEXST_REFUSE = 'OPENTM418263428';
+
+    //支援者应答通知
+    const SUPPAORTER_REPLY = 'OPENTM415748334';
+
+    //紧急救援通知
+    const EMERGANCY_RESCUE = 'OPENTM415748326';
+
+    /**
+     * 发送模板消息
+     */
+    public static function sendTemplate($cid,$openid, $templateId, array $data, $url = null)
+    {
+        $tempid = TemplateInfo::where('cid',$cid)->where('tempkey', $templateId)->value('tempid');
+        if (!$tempid) return false;
+        try {
+            return WechatService::sendTemplate($openid,$tempid,$data,$url,$cid);
+        } catch (\Exception $e) {
+            return false;
+        }
+
+    }
+
+}