作者 lyh

gx

@@ -44,13 +44,14 @@ class MonthCountController extends BaseController @@ -44,13 +44,14 @@ class MonthCountController extends BaseController
44 } 44 }
45 45
46 /** 46 /**
47 - * @remark :获取关键字解锁 47 + * @remark :获取关键字
48 * @name :getKeyword 48 * @name :getKeyword
49 * @author :lyh 49 * @author :lyh
50 * @method :post 50 * @method :post
51 * @time :2023/7/4 9:58 51 * @time :2023/7/4 9:58
52 */ 52 */
53 - public function getKeyword(){  
54 - 53 + public function getKeyword(MonthCountLogic $monthCountLogic){
  54 + $data = $monthCountLogic->getKeywordLists();
  55 + $this->response('success',Code::SUCCESS,$data);
55 } 56 }
56 } 57 }
@@ -167,6 +167,25 @@ class MonthCountLogic extends BaseLogic @@ -167,6 +167,25 @@ class MonthCountLogic extends BaseLogic
167 $startTime = date("Y-m-d", strtotime("-9 months", mktime(0, 0, 0))); 167 $startTime = date("Y-m-d", strtotime("-9 months", mktime(0, 0, 0)));
168 $ensTime = date('Y-m-d',time()); 168 $ensTime = date('Y-m-d',time());
169 $lists = $count->list(['date'=>['between',[$startTime,$ensTime]],'project_id'=>$this->user['project_id']]); 169 $lists = $count->list(['date'=>['between',[$startTime,$ensTime]],'project_id'=>$this->user['project_id']]);
170 - return $this->success($lists); 170 + $groupedData = [];
  171 + foreach ($lists as $k=>$v){
  172 + $month = date('Y-m', strtotime($v['date']));
  173 + if(!isset($groupedData[$month])){
  174 + $groupedData[$month] = [];
  175 + }
  176 + $groupedData[$month][] = $v;
  177 + }
  178 + return $this->success($groupedData);
  179 + }
  180 +
  181 + /**
  182 + * @remark :获取关键字列表
  183 + * @name :getKeywordLists
  184 + * @author :lyh
  185 + * @method :post
  186 + * @time :2023/7/4 10:19
  187 + */
  188 + public function getKeywordLists(){
  189 + $optimizeModel = new index();
171 } 190 }
172 } 191 }