Commit 7efbfafc by 杨树贤

修改更新限制

parent d6b743a9
......@@ -557,7 +557,7 @@ class DataService
public function checkCompanyName()
{
$suppliers = SupplierChannelModel::where('group_code', '')->where('is_type', 0)
->where('create_time', '<', 1655778780)->where('update_time', '<', 1655778780)->get();
->where('create_time', '>', 1655778780)->where('update_time', '>', 1655778780)->get();
foreach ($suppliers as $supplier) {
$company = (new CompanyService())->getCompanyInfo($supplier['supplier_name'], '', 1);
if ($company) {
......
......@@ -22,13 +22,28 @@ class SupplierValidator
//这个要优先判断
if (!checkPerm('IgnoreCompanyCheck')) {
$regionType = $validateData['region'] == 2 ? 1 : 2;
//还要校验提交上来的公司是否有合法信息
$companyInfo = (new CompanyService())->getCompanyInfo($validateData['supplier_name'],
$validateData['tax_number'],
$regionType);
if (empty($companyInfo)) {
return '公司未进行工商注册,请修改后重新提交';
$needCheckFlag = false;
//新增的,都要去校验,然后修改的话,如果没有集团编码,并且是标准添加(非标准添加,即是特殊权限添加,不需要校验),也要去校验
if (empty($validateData['supplier_id'])) {
$needCheckFlag = true;
}
if (!empty($validateData['supplier_id'])) {
$supplier = SupplierChannelModel::where('supplier_id', $validateData['supplier_id'])
->first()->toArray();
if (empty($supplier['group_code']) && $supplier['is_standard_add'] == 1) {
$needCheckFlag = true;
}
}
if ($needCheckFlag) {
$regionType = $validateData['region'] == 2 ? 1 : 2;
//还要校验提交上来的公司是否有合法信息
$companyInfo = (new CompanyService())->getCompanyInfo($validateData['supplier_name'],
$validateData['tax_number'],
$regionType);
if (empty($companyInfo)) {
return '公司未进行工商注册,请修改后重新提交';
}
}
}
......
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