From 172faa058ffced11d21ebc6dc471353522b6723f Mon Sep 17 00:00:00 2001 From: dengbw Date: Wed, 29 Jun 2022 15:35:54 +0800 Subject: [PATCH] different_629_2 --- home/controllers/h5/Different.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/home/controllers/h5/Different.php b/home/controllers/h5/Different.php index 4f93439b..15b7aae2 100644 --- a/home/controllers/h5/Different.php +++ b/home/controllers/h5/Different.php @@ -153,12 +153,18 @@ class Different extends CI_Controller $list = []; foreach ($val['tag'] as $key2 => $val2) { //检查是否选中标签 - $setValue = ['id' => $val2['id'], 'name' => $val2['name']]; + $setValue = ['id' => $val2['id'], 'name' => $val2['name'], 'order2' => $val2['order']]; $setValue['checked'] = $tag_data && in_array($val2['id'], $tag_data) ? true : false; $list[] = $setValue; } - $tagList[] = ['id' => $val['group_id'], 'name' => $val['group_name'], 'list' => $list]; + if ($list) { + $tagKey = array_column($list, 'order2'); + array_multisort($tagKey, SORT_DESC, $list); + } + $tagList[] = ['id' => $val['group_id'], 'name' => $val['group_name'], 'order' => $val['order'], 'list' => $list]; } + $groupKey = array_column($tagList, 'order'); + array_multisort($groupKey, SORT_DESC, $tagList); } //线索来源 $status = 0; @@ -411,7 +417,6 @@ class Different extends CI_Controller $res_detail = $res_detail ? json_decode($res_detail, true) : []; if ($res_detail && $res_detail['errcode'] == 0 && $res_detail['mobile']) { $session = ['userid' => $res_detail['userid']]; - $expire = 86400 * 1; $this->load->model('app/licheb/App_licheb_users_model', 'mdUsers'); $re_user = $this->mdUsers->get(['mobile' => $res_detail['mobile']]); if ($re_user) { @@ -420,10 +425,9 @@ class Different extends CI_Controller } $session = ['userid' => $res_detail['userid'], 'uid' => $re_user['id'], "uname" => $re_user['uname'] , "mobile" => $re_user['mobile'], "biz_id" => intval($re_user['biz_id'])]; - $expire = 86400 * 7; } $ukey = liche_authcode(json_encode($session, JSON_UNESCAPED_UNICODE), 'ENCODE', $this->secret); - set_cookie("ukey", $ukey, $expire); + set_cookie("ukey", $ukey, 86400 * 1); $this->session = $session; } }