market_team_1025_3
This commit is contained in:
@@ -221,13 +221,22 @@ class Activity extends BaseController
|
||||
}
|
||||
if ($teamIds) {
|
||||
$teamIds = implode(',', $teamIds);
|
||||
$res_org = $this->mdSyliveTeam->select(["teamId in({$teamIds})" => null], 'teamId desc', 0, 0, 'teamId,parentId');
|
||||
$res_org = $this->mdSyliveTeam->select(["teamId in({$teamIds})" => null, 'teamType' => 3], 'teamId desc', 0, 0, 'teamId,parentId');
|
||||
$add_biz = [];
|
||||
if ($res_org) {
|
||||
$this->mdSyliveActivityTeam->update(['status' => -1], ["teamId2 not in({$teamIds})" => null, 'activityId' => $activityId, 'status' => 0]);
|
||||
foreach ($res_org as $v) {
|
||||
$add_biz[] = ['activityId' => $activityId, 'teamId1' => $v['parentId']
|
||||
, 'teamId2' => $v['teamId'], 'createTime' => date('Y-m-d H:i:s')];
|
||||
$teamId1 = $v['parentId'];
|
||||
$teamId2 = $v['teamId'];
|
||||
if ($v['parentId']) {
|
||||
$re_team = $this->mdSyliveTeam->get(["teamId" => $v['parentId']]);
|
||||
if ($re_team && $re_team['parentId']) {
|
||||
$teamId1 = $re_team['parentId'];
|
||||
$teamId2 = $re_team['teamId'];
|
||||
}
|
||||
}
|
||||
$add_biz[] = ['activityId' => $activityId, 'teamId1' => $teamId1
|
||||
, 'teamId2' => $teamId2, 'createTime' => date('Y-m-d H:i:s')];
|
||||
}
|
||||
//增加活动商家
|
||||
$add_biz && $this->mdSyliveActivityTeam->add_batch($add_biz);
|
||||
@@ -320,15 +329,24 @@ class Activity extends BaseController
|
||||
}
|
||||
if ($teamIds) {
|
||||
$teamIds = implode(',', $teamIds);
|
||||
$res_org = $this->mdSyliveTeam->select(["teamId in({$teamIds})" => null], 'teamId desc', 0, 0, 'teamId,parentId');
|
||||
$res_org = $this->mdSyliveTeam->select(["teamId in({$teamIds})" => null, 'teamType' => 3], 'teamId desc', 0, 0, 'teamId,parentId');
|
||||
$add_biz = [];
|
||||
if ($res_org) {
|
||||
$this->mdSyliveActivityTeam->update(['status' => -1], ["teamId2 not in({$teamIds})" => null, 'activityId' => $activityId, 'status' => 0]);
|
||||
foreach ($res_org as $v) {
|
||||
$re_org = $this->mdSyliveActivityTeam->get(['activityId' => $activityId, 'teamId2' => $v['teamId']]);
|
||||
if (!$re_org) {
|
||||
$add_biz[] = ['activityId' => $activityId, 'teamId1' => $v['parentId']
|
||||
, 'teamId2' => $v['teamId'], 'createTime' => date('Y-m-d H:i:s')];
|
||||
$teamId1 = $v['parentId'];
|
||||
$teamId2 = $v['teamId'];
|
||||
if ($v['parentId']) {
|
||||
$re_team = $this->mdSyliveTeam->get(["teamId" => $v['parentId']]);
|
||||
if ($re_team && $re_team['parentId']) {
|
||||
$teamId1 = $re_team['parentId'];
|
||||
$teamId2 = $re_team['teamId'];
|
||||
}
|
||||
}
|
||||
$add_biz[] = ['activityId' => $activityId, 'teamId1' => $teamId1
|
||||
, 'teamId2' => $teamId2, 'createTime' => date('Y-m-d H:i:s')];
|
||||
} else if ($re_org['status'] == -1) {
|
||||
$this->mdSyliveActivityTeam->update(['status' => 0], ['id' => $re_org['id']]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user