wuggemail@foxmail.com 3 months ago
parent
commit
8c4f39eae9
2 changed files with 39 additions and 9 deletions
  1. 18 9
      app/cxinv/controller/Index.php
  2. 21 0
      app/cxinv/model/GodTemp.php

+ 18 - 9
app/cxinv/controller/Index.php

@@ -3,10 +3,18 @@ declare (strict_types = 1);
 
 namespace app\cxinv\controller;
 
-use app\common\Ocr;use think\Request;
+use app\common\Ocr;
+use app\cxinv\model\GodTemp;
+use think\App;
+use think\Request;
 
-class Index
+class Index extends Base
 {
+
+    public function __construct(App $app)
+    {
+        parent::__construct($app);
+    }
     /**
      * 显示资源列表
      *
@@ -27,14 +35,15 @@ class Index
       return  json($data);
 
     }
-
-    /**
-     * 显示创建资源表单页.
-     *
-     * @return \think\Response
-     */
-    public function create()
+    //商品库模糊查询
+    public function List()
     {
+        $param = $this->request->param(['goodName'=>"","code"=>"","page"=>1,"size"=>20],"post",'trim');
+       $where=[];
+       if($param['goodName']!='') $where[]=['goodName','like','%'.$param['goodName'].'%'];
+       if($param['code']!='') $where[]=['code','like','%'.$param['code'].'%'];
+       $list = GodTemp::where($where)->order('id desc')->paginate(['page'=>$param['page'],'list_rows'=>$param['size']]);
+       return success("获取成功",['list'=>$list->items(),'count'=>$list->total()]);
     }
 
     /**

+ 21 - 0
app/cxinv/model/GodTemp.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\cxinv\model;
+
+
+class GodTemp extends Base
+{
+    protected $schema = [
+        'id' => 'bigint:20',
+        'code' => 'varchar:255',
+        'goodName' => 'varchar:255',
+        'cat_info' => 'varchar:255',
+        'cat_code' => 'varchar:255',
+        'cat_name' => 'varchar:255',
+        'status_cn' => 'varchar:255',
+        'check_uname' => 'varchar:255',
+        'companyName' => 'varchar:255',
+    ];
+
+
+}