Commit e77eb752 by 杨树贤

修改逻辑

parent 4dad90cf
...@@ -604,6 +604,8 @@ class DataService ...@@ -604,6 +604,8 @@ class DataService
foreach ($accounts as $account) { foreach ($accounts as $account) {
if (!SupplierReceiptService::isOnlyDigitsAndHyphen($account['account_no'])) { if (!SupplierReceiptService::isOnlyDigitsAndHyphen($account['account_no'])) {
dump($account['account_no']); dump($account['account_no']);
$accountNo = SupplierReceiptService::keepOnlyDigitsAndHyphen($account['account_no']);
dump($accountNo);
} }
} }
} }
......
...@@ -14,4 +14,8 @@ class SupplierReceiptService ...@@ -14,4 +14,8 @@ class SupplierReceiptService
public static function isOnlyDigitsAndHyphen($str) { public static function isOnlyDigitsAndHyphen($str) {
return preg_match("/^[0-9\-]*$/", $str); return preg_match("/^[0-9\-]*$/", $str);
} }
public static function keepOnlyDigitsAndHyphen($str) {
return preg_replace("/[^0-9\-]/", "", $str);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment