| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace common\services;
- use Yii;
- use common\components\configDict;
- use common\components\chuanglanSMS;
- class xhCommonService {
- /**
- * 发送短信
- * @param $mobile
- */
- public static function sendMobileMsg($mobile,$msg,$merchant=null)
- {
- $openId = configDict::getConfig('openId');
- $open = xhWxOpenService::getById($openId);
- $name = $open['name'];
- $sms = new chuanglanSMS('N2890342','abc178c7');
- $sign = isset($merchant) == true ? "【{$merchant['merchantName']}】" : "【{$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];
- }
- }
|