當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Wechat::tplmsg方法代碼示例

本文整理匯總了PHP中Wechat::tplmsg方法的典型用法代碼示例。如果您正苦於以下問題:PHP Wechat::tplmsg方法的具體用法?PHP Wechat::tplmsg怎麽用?PHP Wechat::tplmsg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Wechat的用法示例。


在下文中一共展示了Wechat::tplmsg方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: send

 function send()
 {
     $u = M("user")->where(array(id => intval($_REQUEST['id'])))->find();
     import("@.ORG.Weixin");
     $wechatObj = new Wechat();
     $data = " {\r\n           \"touser\":\"" . $u['wxpas'] . "\",\r\n           \"template_id\":\"SCFdz1m9pGOO6U-LXp6qv8CUJakT3_Zk-74tjdnK0ok\",\r\n           \"url\":\"http://weixin.qq.com/download\",\r\n           \"topcolor\":\"#FF0000\",\r\n           \"data\":{\r\n                   \"first\": {\r\n                       \"value\":\"恭喜你購買成功!\",\r\n                       \"color\":\"#173177\"\r\n                   },\r\n                   \"keyword1\":{\r\n                       \"value\":\"" . $u['realname'] . "\",\r\n                       \"color\":\"#173177\"\r\n                   },\r\n                   \"keynote2\": {\r\n                       \"value\":\"" . $u['id'] . "產品名稱\",\r\n                       \"color\":\"#173177\"\r\n                   },\r\n                   \"keynote3\": {\r\n                       \"value\":\"" . $u['id'] . "\",\r\n                       \"color\":\"#173177\"\r\n                   },\r\n                   \"remark\":{\r\n                       \"value\":\"此訂單信息請點擊這裏查看!!\",\r\n                       \"color\":\"#173177\"\r\n                   }\r\n           }\r\n       }";
     echo $wechatObj->tplmsg($data);
 }
開發者ID:anywn3773,項目名稱:gzsrex,代碼行數:8,代碼來源:UserAction.class.php

示例2: alarm

 function alarm($id, $type)
 {
     //$id=$_REQUEST["id"];
     // $type=$_REQUEST["type"];
     if ($id > 0) {
         $order = M($type . "order")->where("id=" . $id)->find();
         if (empty($order)) {
             $this->error("沒有這個訂單");
         }
         if (!empty($type)) {
             $time = $order["fday"] . "日" . $order["foundtime"];
             $addr = "廣州長湴地鐵口A出口";
         } else {
             $type = "";
             $time = date("y-d-m H", $order['godate']);
             $addr = "無";
         }
         if ($order['userid'] > 0) {
             $u = M("user")->field("wxpas,id")->where("id=" . $order['userid'])->find();
         }
         if ($u["wxpas"] && $order['wxmsg'] < 2) {
             import("@.ORG.Weixin");
             $wechatObj = new Wechat();
             $data = "{\r\n\t\t\t\t\t\t   \"touser\":\"" . $u['wxpas'] . "\",\r\n\t\t\t\t\t\t   \"template_id\":\"ucvAFM1zXILGaaovdwyy-VyMAfq7Ny9bFDrOBG5fuxc\",\r\n\t\t\t\t\t\t   \"url\":\"http://www.gzsrex.com" . U('Api/Pay/wxpay', array('oid' => $order["id"], 'type' => $type)) . "\",\r\n\t\t\t\t\t\t   \"topcolor\":\"#003cff\",\r\n\t\t\t\t\t\t   \"data\":{\r\n\t\t\t\t\t\t\t\t   \"first\": {\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"恭喜你預訂成功\"\r\n\t\t\t\t\t\t\t\t               },\r\n\t\t\t\t\t\t\t\t   \"keyword1\":{\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"" . $order["id"] . "\",\r\n\t\t\t\t\t\t\t\t\t   \"color\":\"#FF6600\"\r\n\t\t\t\t\t\t\t\t               },\r\n\t\t\t\t\t\t\t\t   \"keyword2\": {\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"" . $order["title"] . "\",\r\n\t\t\t\t\t\t\t\t\t   \"color\":\"#FF6600\"\r\n\t\t\t\t\t\t\t\t               },\r\n\t\t\t\t\t\t\t\t   \"keyword3\": {\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"" . $time . "\",\r\n\t\t\t\t\t\t\t\t\t   \"color\":\"#FF6600\"\r\n\t\t\t\t\t\t\t\t               },\r\n\t\t\t\t\t\t\t\t   \"keyword4\": {\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"" . $addr . "\",\r\n\t\t\t\t\t\t\t\t\t   \"color\":\"#FF6600\"\r\n\t\t\t\t\t\t\t\t               },\r\n\t\t\t\t\t\t\t\t\t\"keyword5\": {\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"" . $order['amount'] . "\",\r\n\t\t\t\t\t\t\t\t\t   \"color\":\"#FF6600\"\r\n\t\t\t\t\t\t\t\t               },\t\t   \r\n\t\t\t\t\t\t\t\t   \"remark\":{\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"價格:" . $order['amount'] . "\",\r\n\t\t\t\t\t\t\t\t\t   \"color\":\"#FF6600\"\r\n\t\t\t\t\t\t\t\t               }\r\n\t\t\t\t\t\t   }\r\n\t\t\t\t\t   }";
             /*{{first.DATA}}
             訂單號:{{keyword1.DATA}}
             項目:{{keyword2.DATA}}
             時間:{{keyword3.DATA}}
             地址:{{keyword4.DATA}}
             總價:{{keyword5.DATA}}
             {{remark.DATA}}*/
             $json = $wechatObj->tplmsg($data);
             $result = json_decode($json, true);
             if ($result["errmsg"] == 'ok') {
                 return true;
                 //$this->success("催款成功");
             } else {
                 return false;
                 //$this->success("催款失敗");
             }
         } else {
             return false;
             //$this->success("非微信用戶不能催單!");
         }
     }
 }
開發者ID:anywn3773,項目名稱:gzsrex,代碼行數:46,代碼來源:PayAction.class.php

示例3: import

 function send_notice($data)
 {
     //wx:微信openid
     //wx
     if ($data["wx"]) {
         import("@.ORG.Weixin");
         $wechatObj = new Wechat();
         $data = "{\r\n\t\t\t\t\t\t   \"touser\":\"" . $data['wx'] . "\",\r\n\t\t\t\t\t\t   \"template_id\":\"4QHv1Wt_mUuS5tlxkjAIABQOfWVhSJoxeHEdj7kNb4o\",\r\n\t\t\t\t\t\t   \"url\":\"" . $this->Config['site_url'] . "" . U('Home/Product/chose', array('id' => $data["id"])) . "\",\r\n\t\t\t\t\t\t   \"topcolor\":\"#003cff\",\r\n\t\t\t\t\t\t   \"data\":{\r\n\t\t\t\t\t\t\t\t   \"first\": {\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"預約試駕成功通知!\"\r\n\t\t\t\t\t\t\t\t               },\r\n\t\t\t\t\t\t\t\t   \"keyword1\":{\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"試駕:" . $data['title'] . "\",\r\n\t\t\t\t\t\t\t\t\t   \"color\":\"#FF6600\"\r\n\t\t\t\t\t\t\t\t               },\r\n\t\t\t\t\t\t\t\t   \"keyword2\": {\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"初步通知!\",\r\n\t\t\t\t\t\t\t\t\t   \"color\":\"#FF6600\"\r\n\t\t\t\t\t\t\t\t               },\r\n\t\t\t\t\t\t\t\t   \"remark\":{\r\n\t\t\t\t\t\t\t\t\t   \"value\":\"預約時間:" . $data['time'] . ",我們會盡快安排專員與您聯係!\",\r\n\t\t\t\t\t\t\t\t\t   \"color\":\"#FF6600\"\r\n\t\t\t\t\t\t\t\t               }\r\n\t\t\t\t\t\t   }\r\n\t\t\t\t\t   }";
         /*
         							{{first.DATA}}
         任務名稱:{{keyword1.DATA}}
         通知類型:{{keyword2.DATA}}
         {{remark.DATA}}*/
         echo $wechatObj->tplmsg($data);
         return true;
     } else {
         return false;
     }
 }
開發者ID:anywn3773,項目名稱:bydproject,代碼行數:19,代碼來源:ProductAction.class.php


注:本文中的Wechat::tplmsg方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。