master
wangxinglong 2022-04-21 12:16:31 +08:00
parent 8bfce4f288
commit aa1ebaf31b
1 changed files with 11 additions and 4 deletions

View File

@ -234,16 +234,23 @@ class Business extends Base
'model|商家模式' => 'require',
//'score|评分' => 'require|in:1,2,3,4,5',
'reason|驳回原因' => 'max:100',
'time_limit_start|时限商家模式【开始时间】' => 'requireIf:model,'.BusinessModel::model_time_limit.'|date',
'time_limit_end|时限商家模式【结束时间】' => 'requireIf:model,'.BusinessModel::model_time_limit.'|date|after:'.date("Y-m-d",strtotime("+1 day")),
'time_limit_release_count|时限商家模式可发布签到券个数' => 'requireIf:model,'.BusinessModel::model_time_limit.'|>:0',
]);
if ($validate !== true) {
return $validate;
}
if($item["model"] == BusinessModel::model_time_limit){
$validateModel = $this->validateByApi($item, [
'time_limit_start|时限商家模式【开始时间】' => 'require|date',
'time_limit_end|时限商家模式【结束时间】' => 'require|date|after:'.date("Y-m-d",strtotime("+1 day")),
'time_limit_release_count|时限商家模式可发布签到券个数' => 'require|>:0',
]);
if ($validateModel !== true) {
return $validateModel;
}
}
Db::startTrans();
try {
$business->save($item);