Commit 4dad90cf by 杨树贤

银行账号优化

parent 30680353
......@@ -20,6 +20,7 @@ use App\Model\SupplierAddressModel;
use App\Model\SupplierAttachmentsModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;
use App\Model\SupplierReceiptModel;
use App\Model\UserInfoModel;
use Carbon\Carbon;
use GuzzleHttp\Client;
......@@ -596,5 +597,15 @@ class DataService
}
public static function checkSupplierBandAccount()
{
ini_set('memory_limit', -1);
$accounts = SupplierReceiptModel::select(['account_no', 'supplier_id'])->get()->toArray();
foreach ($accounts as $account) {
if (!SupplierReceiptService::isOnlyDigitsAndHyphen($account['account_no'])) {
dump($account['account_no']);
}
}
}
}
......@@ -11,5 +11,7 @@ use App\Model\SupplierContactModel;
class SupplierReceiptService
{
}
\ No newline at end of file
public static function isOnlyDigitsAndHyphen($str) {
return preg_match("/^[0-9\-]*$/", $str);
}
}
......@@ -10,7 +10,7 @@ class ReceiptValidator
{
//保存相关的验证,别问我为什么不用laravel自带的form-request类
//因为控制器那边已经被之前的人魔改的难用的一比,而且控制器那边还接收了一大堆统一变量
public function checkSave($data,$returnAllError = false)
public function checkSave($data, $returnAllError = false)
{
$receipt = $data;
//整理下请求数据
......@@ -18,6 +18,7 @@ class ReceiptValidator
"bank_name" => "required",
"bank_adderss" => "required",
"account_no" => "required",
//"account_no" => "required|regex:/^[0-9\-]+$/",
"receipt_type" => 'required',
"certificate" => "required",
];
......@@ -34,7 +35,7 @@ class ReceiptValidator
if ($validator->fails()) {
if ($returnAllError) {
return $validator->errors()->all();
}else{
} else {
return $validator->errors()->first();
}
}
......
......@@ -82,5 +82,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route::match(['get', 'post'], '/test', function () {
(new \App\Http\Services\DataService())->exportSupplier();
(new \App\Http\Services\DataService())->checkSupplierBandAccount();
});
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