From e7e299ee81eebf2fbc8b85c5f04934678e484e49 Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Wed, 10 Dec 2025 16:49:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=B9=E9=87=8F=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/pingan/cmmssn/Cmmssn.php | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/agent/admin/controllers/pingan/cmmssn/Cmmssn.php b/agent/admin/controllers/pingan/cmmssn/Cmmssn.php index 9a631bc8..6805d8a7 100644 --- a/agent/admin/controllers/pingan/cmmssn/Cmmssn.php +++ b/agent/admin/controllers/pingan/cmmssn/Cmmssn.php @@ -38,19 +38,27 @@ class Cmmssn extends BaseController public function index_put() { - $params = $this->input_param(); - $row = $this->cmmssn_model->get(['id' => $params['id']]); - if (!$row) { + $ids = $this->input_param('ids'); + if (!$ids) { $this->return_json('参数错误'); } - if ($row['ifSend']) { - $this->return_json('已设置发放'); - } + $ids = implode(',', $ids); +// $row = $this->cmmssn_model->get(['id' => $params['id']]); +// if (!$row) { +// $this->return_json('参数错误'); +// } +// if ($row['ifSend']) { +// $this->return_json('已设置发放'); +// } $updateData = [ 'ifSend' => Pingan_users_cmmssn_model::IF_SEND_YES, 'sendTime' => date('Y-m-d H:i:s') ]; - $res = $this->cmmssn_model->update($updateData, ['id' => $row['id']]); + $where = [ + "id in ({$ids})" => null, + "ifSend" => Pingan_users_cmmssn_model::IF_SEND_NO + ]; + $res = $this->cmmssn_model->update($updateData, $where); if (!$res) { $this->return_json('保存失败'); } @@ -77,6 +85,10 @@ class Cmmssn extends BaseController if (strlen($params['ifSend'])) { $where["ifSend"] = intval($params['ifSend']); } + if ($params['dateRange']) { + $where["createTime>="] = date('Y-m-d 00:00:00', strtotime($params['dateRange'][0])); + $where["createTime<="] = date('Y-m-d 23:59:59', strtotime($params['dateRange'][1])); + } $count = $this->cmmssn_model->count($where); if ($count) { $rows = $this->cmmssn_model->select($where, 'id desc', $page, $limit); @@ -109,7 +121,7 @@ class Cmmssn extends BaseController 'orgName' => $user['orgName'] ?: '', 'userName' => $user['username'] ?: '', 'userCode' => $user['userCode'] ?: '', - 'unlockTime' => strtotime($customer['unlock_time']) > 0 ? $customer['unlock_time'] : '', + 'unlockTime' => $item['createTime'], 'orderTime' => $order['order_time'] ?: '', 'money' => $item['money'] ]; @@ -122,7 +134,7 @@ class Cmmssn extends BaseController 'userName' => $user['username'] ?: '', 'userCode' => $user['userCode'] ?: '', 'orgName' => $user['orgName'] ?: '', - 'unlockTime' => strtotime($customer['unlock_time']) > 0 ? $customer['unlock_time'] : '', + 'unlockTime' => $item['createTime'], 'orderTime' => $order['order_time'] ?: '', 'typeCn' => Pingan_users_cmmssn_model::CF_TYPE_CN[$item['cfType']] ?: '', 'money' => $item['money'],