|
@@ -209,5 +209,30 @@ class Supplier extends BaseController
|
|
|
return $udap ? app_show(0,"修改成功") :error_show(1003,"修改失败");
|
|
|
}
|
|
|
|
|
|
+ //获取所有供应商列表,为了超管账号切换到供应商模式时使用,展现在页面右上角
|
|
|
+ public function supplierListBySuper(){
|
|
|
+
|
|
|
+ $post = $this->request->only(['code'=>'','name'=>'','page'=>1,'size'=>10],'post','trim');
|
|
|
+
|
|
|
+ $where=[['type','<>',3]];//type==3业务公司,其他都是供应商
|
|
|
+
|
|
|
+ if($post['code']!=='') $where[]=['code','like','%'.$post['code'].'%'];
|
|
|
+ if($post['name']!=='') $where[]=['name','like','%'.$post['name'].'%'];
|
|
|
+
|
|
|
+ $count = Db::name('supplier_info')
|
|
|
+ ->where($where)
|
|
|
+ ->count('id');
|
|
|
+
|
|
|
+ $list =Db::name('supplier_info')
|
|
|
+ ->field('id,code,name')
|
|
|
+ ->where($where)
|
|
|
+ ->page((int)$post['page'],(int)$post['size'])
|
|
|
+ ->order(['id'=>'asc'])
|
|
|
+ ->select()
|
|
|
+ ->toArray();
|
|
|
+ return app_show(0,'获取供应商列表成功',['count'=>$count,'list'=>$list]);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|