debug
完善自媒体渠道修改
This commit is contained in:
@@ -77,6 +77,9 @@ class AccountCostLogic extends BaseLogic
|
||||
return false;
|
||||
}
|
||||
|
||||
$mediaChannelCode = trim((string) ($params['media_channel_code'] ?? ''));
|
||||
$mediaChannelName = MediaChannelService::getNameByCode($mediaChannelCode);
|
||||
|
||||
$supportsDeptBinding = AccountCost::supportsDeptBinding();
|
||||
$deptId = $supportsDeptBinding ? (int) ($params['dept_id'] ?? 0) : 0;
|
||||
$deptName = $supportsDeptBinding ? self::resolveDeptName($deptId) : '';
|
||||
@@ -89,7 +92,7 @@ class AccountCostLogic extends BaseLogic
|
||||
if ($supportsDeptBinding) {
|
||||
if (AccountCost::where('id', '<>', (int) $params['id'])
|
||||
->where('cost_date', (string) $model->cost_date)
|
||||
->where('media_channel_code', (string) $model->media_channel_code)
|
||||
->where('media_channel_code', $mediaChannelCode)
|
||||
->where('dept_id', $deptId)
|
||||
->count() > 0) {
|
||||
self::setError('该日期下所选渠道和部门的账户消耗已存在,请直接编辑');
|
||||
@@ -98,6 +101,8 @@ class AccountCostLogic extends BaseLogic
|
||||
}
|
||||
}
|
||||
|
||||
$model->media_channel_code = $mediaChannelCode;
|
||||
$model->media_channel_name = $mediaChannelName;
|
||||
if ($supportsDeptBinding) {
|
||||
$model->dept_id = $deptId;
|
||||
$model->dept_name = $deptName;
|
||||
|
||||
Reference in New Issue
Block a user