|
@@ -228,7 +228,7 @@ class Send_sms_adminAction extends Action
|
|
$where =" where is_send=0";
|
|
$where =" where is_send=0";
|
|
$page=1;
|
|
$page=1;
|
|
$pageSize=50;
|
|
$pageSize=50;
|
|
- $city_code =$admin->selectCityCode();
|
|
|
|
|
|
+ $city_code =$admin->selectCityCode() ;
|
|
$new=array();
|
|
$new=array();
|
|
foreach ($city_code as $v){
|
|
foreach ($city_code as $v){
|
|
$new[]=$v['code'];
|
|
$new[]=$v['code'];
|
|
@@ -243,12 +243,7 @@ class Send_sms_adminAction extends Action
|
|
foreach ($customer_list as $vs){
|
|
foreach ($customer_list as $vs){
|
|
$countryMobile = $this->getCountryMobile($vs['country']);
|
|
$countryMobile = $this->getCountryMobile($vs['country']);
|
|
if($countryMobile==1){
|
|
if($countryMobile==1){
|
|
- $code = substr($vs['tel'] , 0 , 3);
|
|
|
|
- if (in_array($code, $new)) {
|
|
|
|
- $is_send=1;
|
|
|
|
- }else{
|
|
|
|
- $is_send=2;
|
|
|
|
- }
|
|
|
|
|
|
+ $is_send =$this->getSend($vs['tel'],$new);
|
|
}
|
|
}
|
|
$admin->upCodeSmsCustomer($is_send,$vs['id']);
|
|
$admin->upCodeSmsCustomer($is_send,$vs['id']);
|
|
}
|
|
}
|
|
@@ -262,7 +257,32 @@ class Send_sms_adminAction extends Action
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ public function getSend($mobile,$new)
|
|
|
|
+ {
|
|
|
|
+ $mobile= str_replace('-', '', $mobile);
|
|
|
|
+ $mobile= str_replace('_', '', $mobile);
|
|
|
|
+ $mobile= str_replace('(', '', $mobile);
|
|
|
|
+ $mobile= str_replace(')', '', $mobile);
|
|
|
|
+ $mobile= str_replace('+', '', $mobile);
|
|
|
|
+ $mobile= str_replace(' ', '', $mobile);
|
|
|
|
+ $mobile=trim($mobile);
|
|
|
|
+ $lenth=strlen($mobile);
|
|
|
|
+ $frist =(int)substr($mobile, 0, 1 );
|
|
|
|
+ $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)) {
|
|
|
|
+ $is_send=1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return $is_send;
|
|
|
|
+ }
|
|
public function getCountryMobile($countryCode){
|
|
public function getCountryMobile($countryCode){
|
|
$country = $countryCode;
|
|
$country = $countryCode;
|
|
$countrys_en = [ "China", "Afghanistan", "Albania", "Algera",
|
|
$countrys_en = [ "China", "Afghanistan", "Albania", "Algera",
|