|
@@ -541,7 +541,7 @@ class SaleReport extends Base
|
|
|
$value['second_customer_org'] = isset($customer_org1[2]) ? $customer_org1[2] : '';
|
|
|
}
|
|
|
|
|
|
- if ($value['order_type'] == 3 ||$value['order_type']==4) $value['unit'] = Db::name("good_zixun")->alias('gz')->leftJoin('unit u','u.id=gz.good_unit')->where(["gz.spuCode" => $value['good_code'], "gz.is_del" => 0])->value('u.unit');
|
|
|
+ if ($value['order_type'] == 3 || $value['order_type'] == 4) $value['unit'] = Db::name("good_zixun")->alias('gz')->leftJoin('unit u', 'u.id=gz.good_unit')->where(["gz.spuCode" => $value['good_code'], "gz.is_del" => 0])->value('u.unit');
|
|
|
else $value['unit'] = Db::name('good_basic')->alias('gb')->leftJoin('unit u', 'u.id=gb.good_unit')->where(["gb.spuCode" => $value['good_code'], "gb.is_del" => 0])->value('u.unit');
|
|
|
|
|
|
$value['is_stock'] = isset($this->all_stock[$value['is_stock']]) ? $this->all_stock[$value['is_stock']] : '';
|
|
@@ -698,7 +698,7 @@ class SaleReport extends Base
|
|
|
$value['second_customer_org'] = isset($customer_org1[2]) ? $customer_org1[2] : '';
|
|
|
}
|
|
|
|
|
|
- if ($value['order_type'] == 3 || $value['order_type']==4) {
|
|
|
+ if ($value['order_type'] == 3 || $value['order_type'] == 4) {
|
|
|
$value['unit'] = Db::name("good_zixun")
|
|
|
->alias('gz')
|
|
|
->leftJoin('unit u', 'u.id=gz.good_unit')
|
|
@@ -769,8 +769,8 @@ class SaleReport extends Base
|
|
|
$value['二级企业'] = isset($customer_org1[2]) ? $customer_org1[2] : '';
|
|
|
}
|
|
|
|
|
|
- if ($value['order_type'] == 3||$value['order_type']==4) $value['单位'] = Db::name("good_zixun")->alias('gz')
|
|
|
- ->leftJoin('unit u', 'u.id=gz.good_unit')->where(["gz.spuCode" => $value['good_code'], "gz.is_del" => 0])->value('u.unit');
|
|
|
+ if ($value['order_type'] == 3 || $value['order_type'] == 4) $value['单位'] = Db::name("good_zixun")->alias('gz')
|
|
|
+ ->leftJoin('unit u', 'u.id=gz.good_unit')->where(["gz.spuCode" => $value['good_code'], "gz.is_del" => 0])->value('u.unit');
|
|
|
else $value['单位'] = Db::name('good_basic')->alias('gb')->leftJoin('unit u', 'u.id=gb.good_unit')->where(["gb.spuCode" => $value['good_code'], "gb.is_del" => 0])->value('u.unit');
|
|
|
|
|
|
if (!isset($company_tmp[$value['apply_id']])) $company_tmp[$value['apply_id']] = $value['apply_id'];
|
|
@@ -848,8 +848,8 @@ class SaleReport extends Base
|
|
|
$value['second_customer_org'] = isset($customer_org1[2]) ? $customer_org1[2] : '';
|
|
|
}
|
|
|
|
|
|
- if ($value['order_type'] == 3 || $value['order_type']==4) $value['unit'] = Db::name("good_zixun")->alias('gz')->leftJoin('unit u',
|
|
|
- 'u.id=gz.good_unit')->where(["gz.spuCode" => $value['good_code'], "gz.is_del" => 0])->value('u.unit');
|
|
|
+ if ($value['order_type'] == 3 || $value['order_type'] == 4) $value['unit'] = Db::name("good_zixun")->alias('gz')->leftJoin('unit u',
|
|
|
+ 'u.id=gz.good_unit')->where(["gz.spuCode" => $value['good_code'], "gz.is_del" => 0])->value('u.unit');
|
|
|
else $value['unit'] = Db::name('good_basic')->alias('gb')->leftJoin('unit u', 'u.id=gb.good_unit')->where(["gb.spuCode" => $value['good_code'], "gb.is_del" => 0])->value('u.unit');
|
|
|
|
|
|
if (!isset($uid_tmp[$value['apply_id']])) $uid_tmp[$value['apply_id']] = $value['apply_id'];//get_company_name_by_uid($value['apply_id']);//获取创建人的所属部门
|
|
@@ -951,8 +951,8 @@ class SaleReport extends Base
|
|
|
$value['二级企业'] = isset($customer_org1[2]) ? $customer_org1[2] : '';
|
|
|
}
|
|
|
|
|
|
- if ($value['order_type'] == 3 || $value['order_type']==4) $value['单位'] = Db::name("good_zixun")->alias('gz')
|
|
|
- ->leftJoin('unit u','u.id=gz.good_unit')->where(["gz.spuCode" => $value['good_code'], "gz.is_del" => 0])->value('u.unit');
|
|
|
+ if ($value['order_type'] == 3 || $value['order_type'] == 4) $value['单位'] = Db::name("good_zixun")->alias('gz')
|
|
|
+ ->leftJoin('unit u', 'u.id=gz.good_unit')->where(["gz.spuCode" => $value['good_code'], "gz.is_del" => 0])->value('u.unit');
|
|
|
else $value['单位'] = Db::name('good_basic')->alias('gb')->leftJoin('unit u', 'u.id=gb.good_unit')->where(["gb.spuCode" => $value['good_code'], "gb.is_del" => 0])->value('u.unit');
|
|
|
|
|
|
if (!isset($uid_tmp[$value['apply_id']])) $uid_tmp[$value['apply_id']] = get_company_name_by_uid($value['apply_id']);//获取创建人的所属部门
|
|
@@ -1411,7 +1411,7 @@ class SaleReport extends Base
|
|
|
foreach ($data as $value) {
|
|
|
|
|
|
if (!isset($codes[$value['customer_code']])) $codes[$value['customer_code']] = $value['customer_code'];
|
|
|
- if ($value['order_type'] == 3 || $value['order_type']==4) $noble_metal = Db::name("good_zixun")->where(["spuCode" => $value['spuCode'], "is_del" => 0])->value('noble_metal');
|
|
|
+ if ($value['order_type'] == 3 || $value['order_type'] == 4) $noble_metal = Db::name("good_zixun")->where(["spuCode" => $value['spuCode'], "is_del" => 0])->value('noble_metal');
|
|
|
else $noble_metal = Db::name('good_basic')->where(['spuCode' => $value['spuCode'], 'is_del' => 0])->value('noble_metal');
|
|
|
|
|
|
if (!isset($uid_tmp[$value['apply_id']])) $uid_tmp[$value['apply_id']] = $value['apply_id'];
|
|
@@ -1468,7 +1468,7 @@ class SaleReport extends Base
|
|
|
foreach ($data as $value) {
|
|
|
if (!isset($codes[$value['customer_code']])) $codes[$value['customer_code']] = $value['customer_code'];
|
|
|
|
|
|
- if ($value['order_type'] == 3|| $value['order_type']==4) $noble_metal = Db::name("good_zixun")->where(["spuCode" => $value['spuCode'], "is_del" => 0])->value('noble_metal');
|
|
|
+ if ($value['order_type'] == 3 || $value['order_type'] == 4) $noble_metal = Db::name("good_zixun")->where(["spuCode" => $value['spuCode'], "is_del" => 0])->value('noble_metal');
|
|
|
else $noble_metal = Db::name('good_basic')->where(['spuCode' => $value['spuCode'], 'is_del' => 0])->value('noble_metal');
|
|
|
|
|
|
|
|
@@ -2837,7 +2837,7 @@ class SaleReport extends Base
|
|
|
->cursor();
|
|
|
|
|
|
$list = [];
|
|
|
- $total = ['person' => '总计', 'total_cgd' => 0, 'tag_1' => 0, 'tag_2' => 0, 'tag_c' => 0, 'tag_b' => 0, 'tag_zx' => 0];
|
|
|
+ $total = ['person' => '总计', 'total_cgd' => 0, 'tag_1' => 0, 'tag_2' => 0, 'tag_c' => 0, 'tag_b' => 0, 'tag_zx' => 0, 'tag_else' => 0];
|
|
|
foreach ($data as $val) {
|
|
|
|
|
|
if (!isset($list[$val['personid']])) {
|
|
@@ -2849,6 +2849,7 @@ class SaleReport extends Base
|
|
|
'tag_c' => 0,//to C
|
|
|
'tag_b' => 0,//to B
|
|
|
'tag_zx' => 0,//咨询采反总数
|
|
|
+ 'tag_else' => 0,//采销录单采反
|
|
|
];
|
|
|
}
|
|
|
|
|
@@ -2871,6 +2872,9 @@ class SaleReport extends Base
|
|
|
if ($val['order_source'] == 2) {
|
|
|
$list[$val['personid']]['tag_zx']++;
|
|
|
$total['tag_zx']++;
|
|
|
+ } else {
|
|
|
+ $list[$val['personid']]['tag_else']++;
|
|
|
+ $total['tag_else']++;
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -2932,7 +2936,7 @@ class SaleReport extends Base
|
|
|
->where($where)
|
|
|
->cursor();
|
|
|
$list = [];
|
|
|
- $total = ['采购方' => '总计', '订单总量' => 0, '库存品' => 0, '非库存品' => 0, 'toC' => 0, 'toB' => 0, '反馈单数合计' => 0];
|
|
|
+ $total = ['采购方' => '总计', '订单总量' => 0, '库存品' => 0, '非库存品' => 0, 'toC' => 0, 'toB' => 0, '反馈单数合计' => 0, '采销录单采反' => 0];
|
|
|
foreach ($data as $val) {
|
|
|
|
|
|
if (!isset($list[$val['personid']])) {
|
|
@@ -2944,6 +2948,7 @@ class SaleReport extends Base
|
|
|
'toC' => 0,//to C
|
|
|
'toB' => 0,//to B
|
|
|
'反馈单数合计' => 0,//咨询采反总数
|
|
|
+ '采销录单采反' => 0,//采销录单采反
|
|
|
];
|
|
|
}
|
|
|
|
|
@@ -2966,8 +2971,10 @@ class SaleReport extends Base
|
|
|
case 3:
|
|
|
//咨询采反
|
|
|
if ($val['order_source'] == 2) {
|
|
|
- $list[$val['personid']]['反馈单数合计']++;
|
|
|
- $total['反馈单数合计']++;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $list[$val['personid']]['采销录单采反']++;
|
|
|
+ $total['采销录单采反']++;
|
|
|
}
|
|
|
|
|
|
break;
|