|
@@ -242,10 +242,12 @@ class Send_sms_adminAction extends Action
|
|
|
|
|
|
foreach ($customer_list as $vs){
|
|
|
$countryMobile = $this->getCountryMobile($vs['country']);
|
|
|
+ $tel=$this->checkMobileCode($vs['tel']);
|
|
|
if($countryMobile==1){
|
|
|
- $is_send =$this->getSend($vs['tel'],$new);
|
|
|
+ $tel=$this->checkMobileCode($vs['tel']);
|
|
|
+ $is_send =$this->getSend($tel,$new);
|
|
|
}
|
|
|
- $admin->upCodeSmsCustomer($is_send,$vs['id']);
|
|
|
+ $admin->upCodeSmsCustomer($is_send,$vs['id'],$tel);
|
|
|
}
|
|
|
$page=$page+1;
|
|
|
} catch (\Exception $e) {
|
|
@@ -257,8 +259,7 @@ class Send_sms_adminAction extends Action
|
|
|
|
|
|
|
|
|
}
|
|
|
- public function getSend($mobile,$new)
|
|
|
- {
|
|
|
+ public function checkMobileCode($mobile){
|
|
|
$mobile= str_replace('-', '', $mobile);
|
|
|
$mobile= str_replace('_', '', $mobile);
|
|
|
$mobile= str_replace('(', '', $mobile);
|
|
@@ -266,15 +267,21 @@ class Send_sms_adminAction extends Action
|
|
|
$mobile= str_replace('+', '', $mobile);
|
|
|
$mobile= str_replace(' ', '', $mobile);
|
|
|
$mobile=trim($mobile);
|
|
|
- $lenth=strlen($mobile);
|
|
|
$frist =(int)substr($mobile, 0, 1 );
|
|
|
- $code=0;
|
|
|
+ $lenth=strlen($mobile);
|
|
|
+ if($lenth==11&&$frist==1){//例:14696305087
|
|
|
+ $mobile =substr($mobile , 2 , 10);
|
|
|
+ }
|
|
|
+ return $mobile;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getSend($mobile,$new)
|
|
|
+ {
|
|
|
+ $lenth=strlen($mobile);
|
|
|
+ $code =0;
|
|
|
if($lenth==10){
|
|
|
$code = substr($mobile , 0 , 3);
|
|
|
}
|
|
|
- if($lenth==11&&$frist==1){//例:14696305087
|
|
|
- $code = substr($mobile , 1 , 3);
|
|
|
- }
|
|
|
$is_send=2;
|
|
|
if($code){
|
|
|
if (in_array($code, $new)) {
|