5.1,超时未审核活动自动审核失败
5.2,提供主动触发检测活动接口,优化活动倒计时延迟更新的问题 活动富文本统一成多行文本
This commit is contained in:
parent
6d52444847
commit
2d35f7f531
@ -348,7 +348,11 @@ class Activity extends Backend
|
||||
Db::startTrans();
|
||||
try {
|
||||
foreach ($list as $item) {
|
||||
$count += $item->delete();
|
||||
|
||||
//当前申请状态
|
||||
$res = (new \app\common\model\school\activity\Activity())->activity_delete($item->id,'admin',$this->auth->id,true);
|
||||
|
||||
$count += 1;
|
||||
}
|
||||
Db::commit();
|
||||
} catch (PDOException|Exception $e) {
|
||||
|
@ -220,7 +220,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
|
||||
<textarea id="c-content" data-rule="required" class="form-control" rows="5" name="row[content]" cols="50"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -223,7 +223,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||
<textarea id="c-content" data-rule="required" class="form-control" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -223,7 +223,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||
<textarea id="c-content" data-rule="required" class="form-control" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -407,6 +407,8 @@ class Activity extends BaseModel
|
||||
//转化时间戳
|
||||
$sign_start_time = $params["sign_start_time"] && !is_numeric($params["sign_start_time"]) ? strtotime($params["sign_start_time"]) : $params["sign_start_time"];
|
||||
$sign_end_time = $params["sign_end_time"] && !is_numeric($params["sign_end_time"]) ? strtotime($params["sign_end_time"]) : $params["sign_end_time"];
|
||||
|
||||
// var_dump($sign_start_time);
|
||||
//结束时间不能小于开始时间
|
||||
if($sign_end_time<=$sign_start_time){
|
||||
throw new \Exception("报名结束时间不能小于开始时间");
|
||||
@ -548,13 +550,20 @@ class Activity extends BaseModel
|
||||
|
||||
|
||||
$images = is_array($params["images"]) ? $params["images"] : explode(",",$params["images"]);
|
||||
foreach ($images as $key => &$image){
|
||||
|
||||
if(!$image){
|
||||
unset($images[$key]);
|
||||
}
|
||||
|
||||
}
|
||||
// var_dump($images);
|
||||
//轮播图至少3张
|
||||
if(count($images) < 3 || count($images) > 5){
|
||||
throw new \Exception("轮播图至少3张,最多5张");
|
||||
}
|
||||
foreach ($images as $image){
|
||||
if(!$image) throw new \Exception("轮播图不能为空");
|
||||
throw new \Exception("轮播图至少3张,最多5张,当前上传张数为".count($images));
|
||||
}
|
||||
//重新合并成一个字符串
|
||||
$params["images"] = implode(",",$images);
|
||||
|
||||
//发活动是否需要实名认证
|
||||
if(config("site.activity_realname_switch")){
|
||||
@ -737,10 +746,13 @@ class Activity extends BaseModel
|
||||
//非允许提交的字段去掉
|
||||
$params = array_intersect_key($params, array_flip($allowField));
|
||||
|
||||
//原活动不是未开始,不让编辑
|
||||
if($row["status"] != '1' ) throw new \Exception("{$params["title"]}活动已过未开始状态,不允许修改!");
|
||||
|
||||
//报名时间需晚于当前时间
|
||||
$now_time = time();
|
||||
if($now_time > $sign_start_time){
|
||||
// var_dump($sign_start_time);
|
||||
throw new \Exception("报名时间必须是未来时间!");
|
||||
}
|
||||
//如果存在订单则不允许修改,如果已进入报名阶段,也不允许修改
|
||||
@ -1343,8 +1355,18 @@ class Activity extends BaseModel
|
||||
}
|
||||
//如果审核状态是审核中,并且时间已经到了3=待开始,4=进行中,则活动自动取消
|
||||
if(($row["status"]=='3' || $row["status"]=='4') && $row["audit_status"]=='0'){
|
||||
//直接取消
|
||||
$row = $this->cancel($id,"2",false,'admin',0);
|
||||
//直接改为审核失败
|
||||
$row["auth_time"] = time();
|
||||
$row["reason"] = "超期系统自动审核失败,请重发该活动";
|
||||
$row["auth_status"] = 2;
|
||||
$row->save();
|
||||
//审核不通过
|
||||
//审核通过
|
||||
//调用事件
|
||||
$data = ['activity' => $row,"user_id"=>$row["user_id"],"oper_type"=>"admin","oper_id"=>0];
|
||||
\think\Hook::listen('new_activity_auth_fail_after', $data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1516,6 +1538,7 @@ class Activity extends BaseModel
|
||||
|
||||
|
||||
|
||||
|
||||
// //是否采用模型验证
|
||||
// if ($this->modelValidate) {
|
||||
// $name = str_replace("\\model\\", "\\validate\\", get_class($this));
|
||||
@ -2154,6 +2177,9 @@ public static function getHaveActivityDelete($id){
|
||||
$activity = self::getHaveActivityDelete($id);
|
||||
if(!$activity)throw new \Exception("可删除活动不存在!");
|
||||
|
||||
if($oper_type=='user' && $activity["user_id"] != $oper_id) throw new \Exception("您无权删除该活动");
|
||||
|
||||
|
||||
|
||||
//判断逻辑
|
||||
if($trans){
|
||||
|
@ -310,6 +310,7 @@ class Activity extends ManystoreBase
|
||||
|
||||
//允许提交的字段
|
||||
$allowField = [
|
||||
"feel",
|
||||
"title",
|
||||
"cate_ids",
|
||||
"image",
|
||||
@ -322,25 +323,39 @@ class Activity extends ManystoreBase
|
||||
"stock",
|
||||
"content",
|
||||
"refund_id",
|
||||
"start_time",
|
||||
"end_time",
|
||||
"sign_start_time",
|
||||
"sign_end_time",
|
||||
"show",
|
||||
"platform",
|
||||
];
|
||||
"status",
|
||||
"sign_time",
|
||||
"time", ];
|
||||
//非允许提交的字段去掉
|
||||
$params = array_intersect_key($params, array_flip($allowField));
|
||||
|
||||
// var_dump($params);die;
|
||||
|
||||
//'user_id'=>SHOP_USER_ID
|
||||
$params["user_id"] = SHOP_USER_ID;
|
||||
// $params["auth_status"] = $row["auth_status"];
|
||||
// $params["reason"] = $row["reason"];
|
||||
$this->update_check($params,$row);
|
||||
unset($params["auth_status"]);
|
||||
|
||||
// unset($params["auth_status"]);
|
||||
//强制触发审核
|
||||
$params["auth_status"] = 0;
|
||||
$params["reason"] = "";
|
||||
$result = $row->allowField(true)->save($params);
|
||||
$this->update_classes($row["id"],$params);
|
||||
|
||||
$row = $this->model->get($row[ "id" ]);
|
||||
|
||||
|
||||
//调用审核事件触发
|
||||
$data = ['activity' => $row,"user_id"=>SHOP_USER_ID,"oper_type"=>"user","oper_id"=>SHOP_USER_ID];
|
||||
\think\Hook::listen('new_activity_auth_need_after', $data);
|
||||
|
||||
|
||||
// if($auth_success == "1"){
|
||||
// //审核通过
|
||||
// //调用事件
|
||||
|
@ -220,7 +220,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
|
||||
<textarea id="c-content" data-rule="required" class="form-control" rows="5" name="row[content]" cols="50"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -223,7 +223,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||
<textarea id="c-content" data-rule="required" class="form-control" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -223,7 +223,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||
<textarea id="c-content" data-rule="required" class="form-control" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user