diff --git a/app/controller/manager/Business.php b/app/controller/manager/Business.php index d7f3bd0..77376c9 100644 --- a/app/controller/manager/Business.php +++ b/app/controller/manager/Business.php @@ -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);