havocera 1 год назад
Родитель
Сommit
ba57d7692f
3 измененных файлов с 36 добавлено и 0 удалено
  1. 12 0
      app/controller/Index.php
  2. 11 0
      app/model/ZdCpmc.php
  3. 13 0
      app/service/ZdCpmcService.php

+ 12 - 0
app/controller/Index.php

@@ -3,9 +3,11 @@ namespace app\controller;
 
 use app\BaseController;
 use app\model\Ry;
+use app\model\ZdCpmc;
 use app\service\NszyService;
 use app\service\QyBasicService;
 use app\service\RyService;
+use app\service\ZdCpmcService;
 use think\db\exception\DataNotFoundException;
 use think\db\exception\DbException;
 use think\db\exception\ModelNotFoundException;
@@ -73,4 +75,14 @@ class Index extends BaseController
     public function getNszyByQydm():Json{
         return $this->JsonSucess(NszyService::selectNszyByQydm(getQydm()));
     }
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Route("getJiangdou")
+     *
+     */
+    public function getJiangdou(){
+        return json(ZdCpmcService::getQydmBycpmc());
+    }
 }

+ 11 - 0
app/model/ZdCpmc.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class ZdCpmc extends Model
+{
+
+
+}

+ 13 - 0
app/service/ZdCpmcService.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace app\service;
+
+use app\model\ZdCpmc;
+
+class ZdCpmcService
+{
+    static function getQydmBycpmc(){
+        return (new \app\model\ZdCpmc)->field('t_zd_cpmc.qydm,cpmc,count(t_zd_cpmc.bh) as row,q.qymc,q.fzr,q.addr')->where("cpmc","like","%"."豇豆"."%")->group("t_zd_cpmc.qydm")->join("t_qy_basic q",'q.qydm=t_zd_cpmc.qydm')->select();
+    }
+
+}