Commit b93fbf2d by 朱继来

Merge branch 'master' into dev/ver/cloud_1.0.0

parents e76e82c1 32756e23
...@@ -179,6 +179,7 @@ class InquiryItemsReportModel extends Model ...@@ -179,6 +179,7 @@ class InquiryItemsReportModel extends Model
$price_profile = changRate($sale_price,$main_rate,$quote_rate); $price_profile = changRate($sale_price,$main_rate,$quote_rate);
$temp = [ $temp = [
"quote_id"=>$quote_id,
"currency"=>$mainCurrency, "currency"=>$mainCurrency,
"goods_name"=>$itemInfo["goods_name"], "goods_name"=>$itemInfo["goods_name"],
"goods_name_pro"=>$quoteItem["goods_name"], "goods_name_pro"=>$quoteItem["goods_name"],
......
...@@ -179,12 +179,12 @@ class QuoteModel extends Model ...@@ -179,12 +179,12 @@ class QuoteModel extends Model
'it.brand_name', 'it.brand_name',
'it.inquiry_number', 'it.inquiry_number',
]; ];
if ($map) { // if ($map) {
$list = $this->commonQuery($map, $input); $list = $this->commonQuery($map, $input);
} else { // } else {
$list = $this->from('quote as q') // $list = $this->from('quote as q')
->join('inquiry_items as it', 'q.inquiry_items_id', '=', 'it.id'); // ->join('inquiry_items as it', 'q.inquiry_items_id', '=', 'it.id');
} // }
$map['create_uid'] = isset($input['create_uid']) ? $input['create_uid'] : ''; // 报价制单人 $map['create_uid'] = isset($input['create_uid']) ? $input['create_uid'] : ''; // 报价制单人
if ($type == 1) { if ($type == 1) {
...@@ -351,12 +351,18 @@ class QuoteModel extends Model ...@@ -351,12 +351,18 @@ class QuoteModel extends Model
return $data; return $data;
} }
// 通用查询 /**
public function commonQuery($map, $input, $type=1) * 通用查询
* @param [type] $map [description]
* @param [type] $input [description]
* @param integer $query_type [类型,1-返回sql,2-返回数量]
* @return [type] [description]
*/
public function commonQuery($map, $input, $query_type=1)
{ {
$list = $this->from('quote as q')->join('inquiry_items as it', 'q.inquiry_items_id', '=', 'it.id'); $list = $this->from('quote as q')->join('inquiry_items as it', 'q.inquiry_items_id', '=', 'it.id');
if (isset($type) && $type == 4) { if (isset($input['type']) && $input['type'] == 4) {
$list = $list->leftJoin('inquiry as i', 'it.inquiry_id', '=', 'i.id'); $list = $list->leftJoin('inquiry as i', 'it.inquiry_id', '=', 'i.id');
$perm = new PermController; $perm = new PermController;
...@@ -411,7 +417,7 @@ class QuoteModel extends Model ...@@ -411,7 +417,7 @@ class QuoteModel extends Model
}); });
} }
if ($type == 1) return $list; if ($query_type == 1) return $list;
return $list->where('q.create_uid', $input['user_id'])->whereNotIn('q.status', [0, -1])->count(); return $list->where('q.create_uid', $input['user_id'])->whereNotIn('q.status', [0, -1])->count();
} }
......
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