bianjunhui vor 2 Jahren
Ursprung
Commit
9f0e3cb5e2

+ 2 - 2
application/lib/data/adminAction.php

@@ -715,8 +715,8 @@ class AdvertAdminAction extends BaseAction{
             return $result;
         }
         //更改美加州区号用户状态
-        public function upCodeSmsCustomer($is_send,$id){
-            $sql    = "update ly_sms_customer set is_send='{$is_send}' where id='{$id}'";
+        public function upCodeSmsCustomer($is_send,$id,$tel){
+            $sql    = "update ly_sms_customer set is_send='{$is_send}',tel='{$tel}' where id='{$id}'";
             $result = $this->getDbEntity()->execute_sql($sql);
             return $result;
         }

+ 16 - 9
application/module/ctrl/Send_sms_adminAction.class.php

@@ -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)) {

+ 13 - 8
application/module/ctrl/Sms_customer_list_adminAction.class.php

@@ -347,6 +347,7 @@ class Sms_customer_list_adminAction extends Action{
 							continue;
 						}
 						if($country=='United States'||$country=='Canada'){
+                            $tel=$this->checkMobileCode($tel);
                             $is_send =$this->getSend($tel,$new);
 
                         }
@@ -373,9 +374,7 @@ class Sms_customer_list_adminAction extends Action{
 
 	}
 
-
-    public function getSend($mobile,$new)
-    {
+    public function  checkMobileCode($mobile){
         $mobile= str_replace('-', '', $mobile);
         $mobile= str_replace('_', '', $mobile);
         $mobile= str_replace('(', '', $mobile);
@@ -383,15 +382,21 @@ class Sms_customer_list_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)) {