lizhen_gitee 9 mesiacov pred
rodič
commit
f0a3523d0b

+ 2 - 1
application/api/controller/Caozuoguifan.php

@@ -43,11 +43,12 @@ class Caozuoguifan extends Api
     public function lists(){
         $type_id = input('type_id',0);
 
-        $list = Db::name('caozuoguifan')
+        $list = Db::name('caozuoguifan')->field('content',true)
             ->where('company_id',$this->auth->company_id)
             ->where('type_id',$type_id)
             ->autopage()
             ->select();
+        $list = list_domain_image($list,['image']);
 
         $this->success(1, $list);
     }

+ 69 - 0
application/api/controller/worker/News.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace app\api\controller\worker;
+
+use app\common\controller\Api;
+use think\Db;
+/**
+ * 咨询
+ */
+class News extends Api
+{
+    protected $noNeedLogin = [''];
+    protected $noNeedRight = [''];
+
+
+    public function index()
+    {
+        //所有分类
+        $typelist = Db::name('news_type')
+            ->where('company_id',$this->auth->company_id)
+            ->order('id' , 'asc')
+            ->select();
+
+        //第一个分类的内容
+        $list = [];
+        if(!empty($typelist)){
+            $list = Db::name('news')->field('content',true)
+                ->where('company_id',$this->auth->company_id)
+                ->where('type_id',$typelist[0]['id'])
+                ->autopage()
+                ->select();
+            $list = list_domain_image($list,['image']);
+        }
+
+        $rs = [
+            'typelist' => $typelist,
+            'list'     => $list,
+        ];
+
+        $this->success(1, $rs);
+    }
+
+    //操作规范
+    public function lists(){
+        $type_id = input('type_id',0);
+
+        $list = Db::name('news')->field('content',true)
+            ->where('company_id',$this->auth->company_id)
+            ->where('type_id',$type_id)
+            ->autopage()
+            ->select();
+        $list = list_domain_image($list,['image']);
+
+        $this->success(1, $list);
+    }
+
+    //详情
+    public function info(){
+        $id = input('id',0);
+        $list = Db::name('news')
+            ->where('id',$id)
+            ->find();
+        $list = info_domain_image($list, ['image']);
+
+        $this->success(1, $list);
+    }
+
+
+}