Commit bb9ed0d9 by 朱继来

merge

parents ea8e2f5f d7438df8
...@@ -71,7 +71,7 @@ class ApiController extends Controller ...@@ -71,7 +71,7 @@ class ApiController extends Controller
} }
//创建询价明细 //创建询价明细
private function ApiCreateOneItems($input, $id){ private function ApiCreateOneItems($input, $id){
Export((new InquiryItemsModel())->addItems(1,[$input])); Export((new InquiryItemsModel())->addItems($input));
} }
//更新询价明细 //更新询价明细
private function ApiUpdateOneItems($input, $id){ private function ApiUpdateOneItems($input, $id){
...@@ -165,6 +165,11 @@ class ApiController extends Controller ...@@ -165,6 +165,11 @@ class ApiController extends Controller
{ {
Export((new QuoteModel())->import($input)); Export((new QuoteModel())->import($input));
} }
// 批量导入询价
public function ApiImportInquiry($input, $id)
{
Export((new InquiryItemsModel())->import($input));
}
// 删除报价草稿 // 删除报价草稿
public function ApiDeleteQuoteDraft($input, $id) public function ApiDeleteQuoteDraft($input, $id)
......
...@@ -10,11 +10,44 @@ use DB; ...@@ -10,11 +10,44 @@ use DB;
class CommonModel extends Model class CommonModel extends Model
{ {
//搜索联营品牌 //搜索联营品牌
public function BrandList($k) public function BrandList($k,$types=1)
{ {
$brandInfo = DB::connection("spu")->select("select brand_id as value,brand_name as name from lie_brand where brand_name like '%".$k."%' limit 10"); $dbspu = DB::connection("spu");
echo json_encode($brandInfo,JSON_UNESCAPED_UNICODE) ; if ($types == 1) { #模糊搜索
exit(); $brandInfo = $dbspu->select("select brand_id as value,brand_name as name from lie_brand where brand_name like '%".$k."%' limit 10");
echo json_encode($brandInfo,JSON_UNESCAPED_UNICODE) ;
exit();
}else{
$brandInfo = $dbspu->select("select brand_id as brand_id,brand_name as name from lie_brand where brand_name = '".$k."' limit 1");
if (!$brandInfo){
return false;
}else{
return $brandInfo[0]["brand_id"];
}
}
}
/*
* 查询采购名称
*/
public function UserList($k,$types = 1){
$dbcms = DB::connection();
if ($types == 1) { #模糊搜索
$purInfo = $dbcms->select("select userId as value,name as name from user_info where name like '%".$k."%' limit 10");
echo json_encode($purInfo,JSON_UNESCAPED_UNICODE) ;
exit();
}else{
$k = explode(",",$k);
$str = [];
foreach ($k as $k=>$b){
$purInfo = $dbcms->select("select userId as uid,name as user_name from user_info where name = '".$b."'");
if (!$purInfo){
return false;
}
array_push($str,["uid"=>$purInfo[0]["uid"],"user_name"=>$purInfo[0]["user_name"]]);
}
return $str;
}
} }
//导出pdf //导出pdf
...@@ -48,14 +81,6 @@ class CommonModel extends Model ...@@ -48,14 +81,6 @@ class CommonModel extends Model
echo json_encode($temp,JSON_UNESCAPED_UNICODE) ; echo json_encode($temp,JSON_UNESCAPED_UNICODE) ;
} }
/*
* 查询采购名称
*/
public function UserList($k){
$purInfo = DB::connection()->select("select userId as value,name as name from user_info where name like '%".$k."%' limit 10");
echo json_encode($purInfo,JSON_UNESCAPED_UNICODE) ;
}
// 搜索供应商 // 搜索供应商
public function SupplierList($k) public function SupplierList($k)
{ {
......
...@@ -294,6 +294,15 @@ class InquiryModel extends Model ...@@ -294,6 +294,15 @@ class InquiryModel extends Model
return $inqueryId; return $inqueryId;
} }
//生成草稿id
public function FindInquirySn($inquiry_id=''){
$result=$this->where('id','=',$inquiry_id)->select('inquiry_sn')->first();
if(!$result){
return false;
}else{
return $result->inquiry_sn;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment