更新审核委托开始时间

This commit is contained in:
yaooo 2023-09-08 15:45:51 +08:00
parent 59878461cc
commit 11a541c8eb

View File

@ -671,7 +671,7 @@ class Community extends BaseController
} }
// 同意 // 同意
if ($status == 1) { if ($status == 1) {
$res = Db::name('community')->where('community_id', $id)->where('is_del', 0)->update(['status' => $status, 'mer_status' => 1]); $res = Db::name('community')->where('community_id', $id)->where('is_del', 0)->update(['status' => $status, 'mer_status' => 1, 'entrust_start_date' =>date('Y-m-d H:i:s')]);
if (!$res) { if (!$res) {
return app('json')->fail('审核失败'); return app('json')->fail('审核失败');
} }
@ -790,7 +790,7 @@ class Community extends BaseController
return app('json')->fail('当前商户无申请结束此委托商品权限'); return app('json')->fail('当前商户无申请结束此委托商品权限');
} }
$entrustInfo = Db::name('entrust')->where('community_id', $id)->where('is_del', 0)->find(); $entrustInfo = Db::name('entrust')->where('community_id', $id)->where('is_del', 0)->find();
$limitTime = strtotime($entrustInfo['create_time']) + ($entrustInfo['entrust_day'] ?? 0) * 86400; $limitTime = strtotime($entrustInfo['entrust_start_date']) + ($entrustInfo['entrust_day'] ?? 0) * 86400;
if (time() < $limitTime) { if (time() < $limitTime) {
return app('json')->fail('委托时间内不能申请结束委托'); return app('json')->fail('委托时间内不能申请结束委托');
} }
@ -821,7 +821,7 @@ class Community extends BaseController
// 同意 // 同意
if ($status == 1) { if ($status == 1) {
$entrustInfo = Db::name('entrust')->where('community_id', $id)->where('is_del', 0)->find(); $entrustInfo = Db::name('entrust')->where('community_id', $id)->where('is_del', 0)->find();
$limitTime = strtotime($entrustInfo['create_time']) + ($entrustInfo['entrust_day'] ?? 0) * 86400; $limitTime = strtotime($entrustInfo['entrust_start_date']) + ($entrustInfo['entrust_day'] ?? 0) * 86400;
if (time() < $limitTime) { if (time() < $limitTime) {
return app('json')->fail('委托时间内不能结束委托'); return app('json')->fail('委托时间内不能结束委托');
} }