|
@@ -138,15 +138,15 @@ class OrderOutChild extends Base
|
|
|
->select()
|
|
|
->toArray();
|
|
|
|
|
|
- $all_apply_id = array_column($list, 'apply_id');
|
|
|
- $company_name = get_company_name_by_uid($all_apply_id);
|
|
|
+// $all_apply_id = array_column($list, 'apply_id');
|
|
|
+// $company_name = get_company_name_by_uid($all_apply_id);
|
|
|
|
|
|
//校验是否开通了供应商账号
|
|
|
$supp_account = checkHasAccountBySupplierNos(array_unique(array_column($list, 'supplierNo')));
|
|
|
|
|
|
$data = [];
|
|
|
foreach ($list as $value) {
|
|
|
- $value['company_name'] = $company_name[$value['apply_id']] ?? '';
|
|
|
+// $value['company_name'] = $company_name[$value['apply_id']] ?? '';
|
|
|
$value['has_account'] = (int)isset($supp_account[$value['supplierNo']]);
|
|
|
$data[] = $value;
|
|
|
}
|
|
@@ -175,6 +175,7 @@ class OrderOutChild extends Base
|
|
|
'apply_name' => '',
|
|
|
'order_type' => '',
|
|
|
'relaComNo' => '',
|
|
|
+ 'use_type' => '',
|
|
|
], 'post', 'trim');
|
|
|
|
|
|
$where = [['a.is_del', '=', 0]];
|
|
@@ -195,6 +196,7 @@ class OrderOutChild extends Base
|
|
|
if ($param['apply_name'] != '') $where[] = ['a.apply_name', 'like', '%' . $param['apply_name'] . '%'];
|
|
|
if ($param['order_type'] != '') $where[] = ['a.order_type', '=', $param['order_type']];
|
|
|
if ($param['relaComNo'] != '') $where[] = ['a.companyNo', '=', $param['relaComNo']];
|
|
|
+ if ($param['use_type'] !== '') $where[] = ['p.use_type', '=', $param['use_type']];
|
|
|
|
|
|
$condition = '';
|
|
|
//只有level2的账号过滤数据权限
|
|
@@ -226,24 +228,28 @@ class OrderOutChild extends Base
|
|
|
|
|
|
$list = Db::name('order_out_child')
|
|
|
->alias('a')
|
|
|
- ->field('a.outChildCode 发货工单号,a.orderCode 确认单编号,a.outCode 发货申请单号,a.companyNo 业务公司编号,a.companyName 业务公司名称,a.customer_code 客户编号,a.customer_name 客户名称,a.supplierNo 供应商编号,a.supplierName 供应商名称,a.spuCode 商品成本编号,a.skuCode 商品上线编号,a.good_name 商品名称,case a.order_source when 1 then "直接下单" when 2 then "咨询" when 3 then "项目" when 4 then "平台" when 5 then "有赞" when 6 then "售后补换货" when 7 then "报备转单" when 8 then "支付渠道" end "订单来源",case order_type when 1 then "备库" when 2 then "非库存" when 3 then "咨询商品" when 4 then "报备商品" end "商品类型",a.num 数量,case a.status when 1 then "待发货" when 2 then "发货完成" when 3 then "已收货" when 4 then "已全部退货" end "分单状态",a.addtime 下单时间,a.apply_name 申请人名称,a.post_name 物流公司,a.post_code 物流单号,a.post_fee 物流费用')
|
|
|
+ ->field('a.outChildCode 发货工单号,a.outCode 发货单编号,a.orderCode 销售订单编号,"" 供应商端,case a.status when 1 then "待发货" when 2 then "发货完成" when 3 then "已收货" when 4 then "已全部退货" end "状态" ,case a.order_type when 1 then "备库" when 2 then "非库存" when 3 then "咨询商品" when 4 then "报备商品" end "商品类型",case a.order_source when 1 then "直接下单" when 2 then "咨询" when 3 then "项目" when 4 then "平台" when 5 then "有赞" when 6 then "售后补换货" when 7 then "报备转单" when 8 then "支付渠道" end "订单来源",a.num 总数量,a.wsm_code 仓库编号,c.name 仓库名称,a.spuCode 商品成本编码,a.skuCode 商品上线编码,a.companyNo 业务公司编号,a.companyName 业务公司名称,a.customer_code 客户编号,a.customer_name 客户名称,a.supplierNo 供应商编号,a.supplierName 供应商名称,a.addtime 下单时间,a.apply_name 申请人,case p.use_type when 0 then "无" when 1 then "to B" when 2 then "to C" end 对接类型')
|
|
|
+ ->leftJoin('warehouse_info c', 'c.wsm_code=a.wsm_code AND c.is_del=0')
|
|
|
+ ->leftJoin('sale d', 'd.orderCode=a.orderCode AND d.is_del=0')
|
|
|
+ ->leftJoin('platform p', 'p.id=d.platform_id AND p.is_del=0')
|
|
|
->order(['a.addtime' => 'desc', 'a.id' => 'desc'])
|
|
|
->where($where)
|
|
|
->where($condition)
|
|
|
->select()
|
|
|
->toArray();
|
|
|
|
|
|
+ //校验是否开通了供应商账号
|
|
|
+ $supp_account = checkHasAccountBySupplierNos(array_unique(array_column($list, '供应商编号')));
|
|
|
+
|
|
|
// $all_apply_id = array_column($list, 'apply_id');
|
|
|
// $company_name = get_company_name_by_uid($all_apply_id);
|
|
|
|
|
|
// $data = [];
|
|
|
-// foreach ($list as &$value) {
|
|
|
-//
|
|
|
+ foreach ($list as &$value) {
|
|
|
+ $value['供应商端'] = isset($supp_account[$value['供应商编号']]) ? '已开通' : '未开通';
|
|
|
// $value['company_name'] = $company_name[$value['apply_id']] ?? '';
|
|
|
// unset($value['apply_id']);
|
|
|
-//
|
|
|
-
|
|
|
-// }
|
|
|
+ }
|
|
|
|
|
|
if (empty($list)) $list[] = ['没有相关可导出的数据'];
|
|
|
excelSave('发货工单' . date('YmdHis'), array_keys($list[0]), $list);
|
|
@@ -369,7 +375,7 @@ class OrderOutChild extends Base
|
|
|
//校验是否开通了供应商账号
|
|
|
$supp_account = checkHasAccountBySupplierNos([$info['supplierNo']]);
|
|
|
|
|
|
- $info['has_account']=(int)isset($supp_account[$info['supplierNo']]);
|
|
|
+ $info['has_account'] = (int)isset($supp_account[$info['supplierNo']]);
|
|
|
return json_show(0, '获取详情成功', $info);
|
|
|
|
|
|
}
|