CsController.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace saas\controllers;
  3. use biz\auth\services\AuthService;
  4. use biz\merchant\services\MerchantService;
  5. use common\components\util;
  6. use common\components\wxUtil;
  7. use Yii;
  8. class CsController extends BaseController
  9. {
  10. public $withoutLogin = ['index'];
  11. public function actionIndex()
  12. {
  13. $content = '&lt;p&gt;&lt;a data-miniprogram-appid=&quot;wxe4675bab299a52f7&quot; data-miniprogram-path=&quot;pages/case/casedetail?mainId=184&amp;owner_user_id=19&quot; href=&quot;&quot;&gt;&lt;img src=&quot;https://www.meijiabang.com/0.gif&quot; alt=&quot;&quot; data-width=&quot;null&quot; data-ratio=&quot;NaN&quot;&gt;&lt;/a&gt;&lt;/p&gt;';
  14. $content = $this->html_out($content);
  15. $content = '<p><a data-miniprogram-appid="wxe4675bab299a52f7" data-miniprogram-path="pages/case/casedetail?mainId=184&owner_user_id=19" href=""><img src="https://www.meijiabang.com/0.gif" alt="" data-width="null" data-ratio="NaN"></a></p>';
  16. $merchant = MerchantService::getMerchantById(12362);
  17. $openId = 'oTFbYvsjwgVwXggwtlM2ESAKwuN8';
  18. $return = wxUtil::sendMsg($content, $merchant, $openId);
  19. print_r($return);
  20. }
  21. public function html_out($str)
  22. {
  23. if (function_exists('htmlspecialchars_decode')) {
  24. $str = htmlspecialchars_decode($str);
  25. } else {
  26. $str = html_entity_decode($str);
  27. }
  28. $str = stripslashes($str);
  29. return $str;
  30. }
  31. }