|
@@ -35,6 +35,28 @@ class Supplier extends BaseController
|
|
|
return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
|
|
|
}
|
|
|
|
|
|
+ /**获取供应商列表
|
|
|
+* @return \think\response\Json|void
|
|
|
+* @throws \think\db\exception\DataNotFoundException
|
|
|
+* @throws \think\db\exception\DbException
|
|
|
+* @throws \think\db\exception\ModelNotFoundException
|
|
|
+ */
|
|
|
+ public function SupplierAll()
|
|
|
+ {
|
|
|
+ $post = $this->post;
|
|
|
+ $condition = [];
|
|
|
+ $name= isset($post['name'])&&$post['name']!="" ? trim($post['name']) :"";
|
|
|
+ if($name!=""){
|
|
|
+ $condition []=["name","like","%{$name}%"];
|
|
|
+ }
|
|
|
+ $type=isset($post['type'])&&$post['type']!="" ? trim($post['type']) :"";
|
|
|
+ if($type!=""){
|
|
|
+ $condition []=["type","=",$type];
|
|
|
+ }
|
|
|
+ $list = Db::name("supplier_info")->where($condition)->field("id,code,name,contector,nature,type,mobile,address,post,addtime,LENGTH(companyName) as weight")->order("weight asc")->select();
|
|
|
+ return app_show(0,"获取成功",$list);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取供应商信息
|
|
|
*
|