提交 e4ea485c authored 作者: chengye's avatar chengye

初始化项目2020-5-9

上级 5db83e68
...@@ -14,20 +14,12 @@ class opencustomerClassAction extends openapiAction ...@@ -14,20 +14,12 @@ class opencustomerClassAction extends openapiAction
//客户列表 //客户列表
public function listAction(){ public function listAction(){
$post = $_POST; $post = $_POST;
$email=$post['email']; $page = $post['size'] ? $post['size']:0;
$sql = "select u.id,u.email from oa_userinfo u where u.email = '$email'"; $page_size = $post['page_size']? $post['page_size']:10;
$sort =$post['sort']? $post['sort']: 'desc';
$sql = 'select id,contract_number,name from [Q]customer as c order by c.id '.$sort.' limit '.$page.','.$page_size;
$data = $this->db->getall($sql); $data = $this->db->getall($sql);
$uid=$data[0]['id'];//用户id
$data = $this->db->getall('select id,contract_number,name from
oa_customer
where (uid = ' . $uid . '
or department_id=(select deptname from oa_userinfo where id=' . $uid . ')
or department_id like concat((select deptname from oa_userinfo where id=' . $uid . '),",%")
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '))
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '),",%"))
and status = 1
order by id desc');
foreach ($data as $key => $vo){ foreach ($data as $key => $vo){
$supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]customer_bank_info where mid='.$vo['id']; $supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]customer_bank_info where mid='.$vo['id'];
$contacts ='select name,job,tel,email,adress,remarks from [Q]contracts where mid='.$vo['id']; $contacts ='select name,job,tel,email,adress,remarks from [Q]contracts where mid='.$vo['id'];
......
...@@ -69,7 +69,7 @@ class openfkClassAction extends openapiAction ...@@ -69,7 +69,7 @@ class openfkClassAction extends openapiAction
} }
//启动流程 //启动流程
$this->goflow($id); $this->goflow($id);
$this->showreturn(['numb' => $this->data['docnum']], '插入数据成功', '200'); $this->showreturn(['numb' => $this->data['docnum'],'id'=>$id], '插入数据成功', '200');
} else $this->showreturn([], '插入数据失败', '201'); } else $this->showreturn([], '插入数据失败', '201');
} }
......
...@@ -15,17 +15,11 @@ class opensupplierClassAction extends openapiAction ...@@ -15,17 +15,11 @@ class opensupplierClassAction extends openapiAction
//供应商列表 //供应商列表
public function listAction(){ public function listAction(){
$post = $_POST; $post = $_POST;
$email=$post['email']; $page = $post['size'] ? $post['size']:0;
$sql = "select u.id,u.email from oa_userinfo u where u.email = '$email'"; $page_size = $post['page_size']? $post['page_size']:10;
$sort =$post['sort']? $post['sort']: 'desc';
$sql = 'select id,number,name from [Q]supplier as c order by c.id '.$sort.' limit '.$page.','.$page_size;
$data = $this->db->getall($sql); $data = $this->db->getall($sql);
$uid=$data[0]['id'];//用户id
$data = $this->db->getall('select id,number,name from oa_supplier where (uid = ' . $uid . '
or department_id=(select deptname from oa_userinfo where id=' . $uid . ')
or department_id like concat((select deptname from oa_userinfo where id=' . $uid . '),",%")
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '))
or department_id like concat("%,",(select deptname from oa_userinfo where id=' . $uid . '),",%"))
and status = 1
order by id desc');
foreach ($data as $key => $vo){ foreach ($data as $key => $vo){
$supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]supplier_bank_info where mid='.$vo['id']; $supp ='select open_bank_name,bank_code,bank_holder,open_address from [Q]supplier_bank_info where mid='.$vo['id'];
$contacts ='select name,job,tel,email,adress,remarks from [Q]supplier_contract where mid='.$vo['id']; $contacts ='select name,job,tel,email,adress,remarks from [Q]supplier_contract where mid='.$vo['id'];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论