From 25fc318f0284c58b4e6de88536dcf6846babb6d0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 27 Oct 2022 22:05:29 +0800 Subject: [PATCH] 1 --- webapp/controller/GuideController.class.php | 32 +++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/webapp/controller/GuideController.class.php b/webapp/controller/GuideController.class.php index 6fbf1ab8..2ea9b723 100644 --- a/webapp/controller/GuideController.class.php +++ b/webapp/controller/GuideController.class.php @@ -6,12 +6,40 @@ class GuideController extends BaseAuthedController { public function getData() { - + $row = SqlHelper::ormSelectOne( + $this->_getSelfMysql(), + 't_guide_data', + array( + 'account_id' => $this->_getAccountId() + ) + ); + echo json_encode(array( + 'errcode' => 0, + 'errmsg' => "OK", + 'data' => $row ? $row['data'] : null + )); } public function setData() { - + $data = getReqVal('data', ''); + SqlHelper::upsert( + $this->_getSelfMysql(), + 't_guide_data', + array( + 'account_id' => $this->_getAccountId(), + ), + array( + 'data' => $data, + 'modifytime' => $this->_getNowTime(), + ), + array( + 'account_id' => $this->_getAccountId(), + 'data' => $data, + 'createtime' => $this->_getNowTime(), + 'modifytime' => $this->_getNowTime() + ) + ); } }