From 4129dfa3d1881dbfa385b6aa5356470df1fafb8a Mon Sep 17 00:00:00 2001 From: dengbw Date: Mon, 15 May 2023 17:38:11 +0800 Subject: [PATCH] market_groups_delete --- .../api/institution/Organization.php | 5 ++-- market/controllers/api/sylive/Groups.php | 5 ++-- .../api/sylive/GroupsStatistics.php | 29 ++++++++++--------- market/controllers/api/sylive/GroupsUser.php | 23 +++++++++++++-- 4 files changed, 40 insertions(+), 22 deletions(-) diff --git a/market/controllers/api/institution/Organization.php b/market/controllers/api/institution/Organization.php index fa2683c1..6d620ce0 100644 --- a/market/controllers/api/institution/Organization.php +++ b/market/controllers/api/institution/Organization.php @@ -215,11 +215,10 @@ class Organization extends BaseController * Notes:机构详情 * Created on: 2022/12/09 10:37 * Created by: dengbw - * @param null $organizationId */ - public function info_get($organizationId = null) + public function info_get() { - $organizationId = intval($organizationId); + $organizationId = intval($this->input_param('organizationId')); if (!$organizationId) { $this->return_json('参数错误'); } diff --git a/market/controllers/api/sylive/Groups.php b/market/controllers/api/sylive/Groups.php index a5140daf..133874da 100644 --- a/market/controllers/api/sylive/Groups.php +++ b/market/controllers/api/sylive/Groups.php @@ -194,11 +194,10 @@ class Groups extends BaseController * Notes:删除分组 * Created on: 2022/9/19 11:08 * Created by: dengbw - * @param null $groupsId */ - public function index_delete($groupsId = null) + public function index_delete() { - $groupsId = intval($groupsId); + $groupsId = intval($this->input_param('id')); if (!$groupsId) { $this->return_json('参数错误'); } diff --git a/market/controllers/api/sylive/GroupsStatistics.php b/market/controllers/api/sylive/GroupsStatistics.php index 0de0de3c..8c5d5d73 100644 --- a/market/controllers/api/sylive/GroupsStatistics.php +++ b/market/controllers/api/sylive/GroupsStatistics.php @@ -29,9 +29,9 @@ class GroupsStatistics extends BaseController * Created on: 2022/12/05 14:48 * Created by: dengbw */ - public function index_get($activityId = null) + public function index_get() { - $activityId = intval($activityId); + $activityId = intval($this->input_param('activityId')); if (!$activityId) { $this->return_json('参数错误'); } @@ -47,17 +47,20 @@ class GroupsStatistics extends BaseController foreach ($res_item as $k => $v) { $goods[] = ['name' => $v['title'], 'value' => intval($v['itemId'])]; } - if ($re['activityStart'] != '0000-00-00 00:00:00' && $re['timeEnd'] != '0000-00-00 00:00:00') { - $activityStart = date("Y-m-d", strtotime($re['activityStart'])); - $times = 0; - while ($times >= 0) { - $day = date("Y-m-d", strtotime("$activityStart +{$times} day")); - if ($day <= $re['timeEnd'] & $times <= 15) { - $days[] = ['name' => $day, 'value' => $day]; - $times++; - } else { - $times = -1; - } + $activityStart = strtotime($re['activityStart']) > 0 ? strtotime($re['activityStart']) : strtotime($re['timeStart']) - 7 * 24 * 60 * 60; + $end_time = time() < strtotime($re['timeEnd']) ? time() : strtotime($re['timeEnd']); + $diff_seconds = $end_time - $activityStart; + $diff_days = ceil($diff_seconds / 86400); + $timeEnd = strtotime($re['timeEnd']);//直播结束往前七天 + for ($i = 0; $i < $diff_days; $i++) { + if (time() < strtotime($re['timeEnd'])) { + $day = date('Y-m-d', time() - $i * 24 * 60 * 60); + } else { + $day = date('Y-m-d', $timeEnd - $i * 24 * 60 * 60); + } + $days[] = ['name' => $day, 'value' => $day]; + if ($i == 14) { + break; } } $title = $re['title']; diff --git a/market/controllers/api/sylive/GroupsUser.php b/market/controllers/api/sylive/GroupsUser.php index 75625250..280659ae 100644 --- a/market/controllers/api/sylive/GroupsUser.php +++ b/market/controllers/api/sylive/GroupsUser.php @@ -112,11 +112,10 @@ class GroupsUser extends BaseController * Notes:同步原始门店用户 * Created on: 2022/12/9 12:21 * Created by: dengbw - * @param null $groupsId */ - public function synchronous_get($groupsId = null) + public function synchronous_get() { - $groupsId = intval($groupsId); + $groupsId = intval($this->input_param('groupsId')); if (!$groupsId) { $this->return_json('参数错误'); } @@ -232,6 +231,24 @@ class GroupsUser extends BaseController $this->return_response(); } + /** + * Notes:删除用户 + * Created on: 2022/10/21 17:11 + * Created by: dengbw + */ + public function batch_delete() + { + $ids = $this->input_param('ids'); + if (!$ids) { + $this->return_json('参数错误'); + } + $str_ids = implode(',', $ids); + if ($str_ids) { + $this->mdSyliveGroupsUser->update(['status' => -1], ["groupsUserId in($str_ids)" => null]); + } + $this->return_response(); + } + /** * Notes:栓验字段 * Created on: 2022/9/21 15:52