Commit e78f1734 by 杨树贤

修复逻辑

parent 6509b6c2
......@@ -715,6 +715,10 @@ class SupplierApiController extends Controller
//删除redis状态
$redis->hdel('supplier_status_before_disable', $supplierId);
$logService = new LogService();
SupplierChannelModel::where('supplier_id', $supplierId)->update([
'disable_reason' => '',
'update_time' => time(),
]);
$logService->AddLog($supplierId, LogModel::UPDATE_OPERATE, '取消禁用', '取消禁用供应商');
$this->response(0, '取消禁用成功');
} else {
......
......@@ -322,8 +322,8 @@ class SyncSupplierService
//判断是否是同名多供应商,如果是的话,如果是之前已经禁用的,则直接跳过
if (count($suppliers) > 1) {
if ($supplier['status'] == SupplierChannelModel::STATUS_DISABLE && ($supplier['is_entity'] != SupplierChannelModel::IS_ENTITY_NEED_CONFIRM && $supplier['is_entity'] != SupplierChannelModel::IS_ENTITY_TRUE)) {
Log::warning("检测到同名供应商并且属于禁用(实体名单不为待处理并且也不为实体名单)状态,跳过,供应商id为 : " . $supplier['supplier_id']);
continue;
Log::warning("检测到同名供应商并且属于禁用(实体名单不为待处理并且也不为实体名单)状态,供应商id为 : " . $supplier['supplier_id']);
// continue;
}
}
//判断是否是人工禁用的,是的话,也跳过
......@@ -332,6 +332,12 @@ class SyncSupplierService
Log::warning("检测到供应商并且属于禁用(人工禁用)状态,跳过,供应商id为 : " . $supplier['supplier_id']);
continue;
}
if (strpos($supplier['disable_reason'], '人工禁用') !== false) {
Log::warning("检测到供应商并且属于禁用(人工禁用新)状态,跳过,供应商id为 : " . $supplier['supplier_id']);
continue;
}
$originIsEntity = $supplier['is_entity'];
//$supplier = $supplier->toArray();
$supplierId = $supplier['supplier_id'];
......@@ -358,7 +364,8 @@ class SyncSupplierService
$preStatus = SupplierChannelModel::STATUS_IN_REVIEW;
}
//修改供应商的状态
SupplierChannelModel::where('supplier_id', $supplierId)->update([
SupplierChannelModel::where('supplier_id', $supplierId)
->update([
'is_entity' => $isEntityResult,
'update_time' => time(),
//这里的逻辑是,因为取消实体名单以后,如果之前的状态是黑名单的话,直接变成待提审
......
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