| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace common\services;
- use common\components\util;
- use Yii;
- use common\components\dict;
- use common\components\chuanglanSMS;
- class xhCommonService
- {
-
- /**
- * 发送短信
- * @param $mobile
- */
- public static function sendMobileMsg($mobile, $msg, $merchant = null)
- {
- $open = [];
- if (empty($open)) {
- util::fail('取平台信息错误');
- }
- $name = $open['name'];
- $sms = new chuanglanSMS('N2890342', 'abc178c7');
- $sign = isset($merchant) == true ? "【{$merchant['name']}】" : "【{$name}】";
- $msg .= $sign;
- $result = $sms->send($mobile, $msg);
- }
-
- /**
- * 传入最大的照片,输出三种照片:大 中 小
- */
- public static function getImgList($largeImg)
- {
- $extend = substr($largeImg, strrpos($largeImg, '.') + 1);
- $pre = substr($largeImg, 0, strrpos($largeImg, '.'));
- return ['small' => $pre . '_50.' . $extend, 'medium' => $pre . '_200.' . $extend, 'large' => $largeImg];
- }
-
- }
|