|
|
@@ -270,10 +270,10 @@ class ExportExcel extends AuthController
|
|
|
['cate_id', ''],
|
|
|
['type', 1, '', 'status'],
|
|
|
['ids', ''],
|
|
|
- ['supplier_id', 0],
|
|
|
- ['store_id', 0],
|
|
|
- ['store_label_id', ''],
|
|
|
- ['brand_id', '']
|
|
|
+ ['supplier_id', 0],
|
|
|
+ ['store_id', 0],
|
|
|
+ ['store_label_id', ''],
|
|
|
+ ['brand_id', '']
|
|
|
]);
|
|
|
if ($where_tmp['ids']) {
|
|
|
$where['id'] = explode(',', $where_tmp['ids']);
|
|
|
@@ -281,15 +281,15 @@ class ExportExcel extends AuthController
|
|
|
unset($where_tmp['ids']);
|
|
|
$where = $where_tmp;
|
|
|
}
|
|
|
- if ($where_tmp['supplier_id']) {
|
|
|
- $where['relation_id'] = $where_tmp['supplier_id'];
|
|
|
- $where['type'] = 2;
|
|
|
- } elseif ($where_tmp['store_id']) {
|
|
|
- $where['relation_id'] = $where_tmp['store_id'];
|
|
|
- $where['type'] = 1;
|
|
|
- } else {
|
|
|
- $where['pid'] = 0;
|
|
|
- }
|
|
|
+ if ($where_tmp['supplier_id']) {
|
|
|
+ $where['relation_id'] = $where_tmp['supplier_id'];
|
|
|
+ $where['type'] = 2;
|
|
|
+ } elseif ($where_tmp['store_id']) {
|
|
|
+ $where['relation_id'] = $where_tmp['store_id'];
|
|
|
+ $where['type'] = 1;
|
|
|
+ } else {
|
|
|
+ $where['pid'] = 0;
|
|
|
+ }
|
|
|
$data = $services->searchList($where, true, $this->service->limit);
|
|
|
return $this->success($this->service->storeProduct($data['list'] ?? []));
|
|
|
}
|
|
|
@@ -309,18 +309,19 @@ class ExportExcel extends AuthController
|
|
|
['real_name', ''],
|
|
|
['is_del', ''],
|
|
|
['data', '', '', 'time'],
|
|
|
- ['type', ''],
|
|
|
+ ['type', ''],
|
|
|
['export_type', ''],
|
|
|
['pay_type', ''],
|
|
|
- ['plat_type', -1],
|
|
|
+ ['plat_type', -1],
|
|
|
['order', ''],
|
|
|
['field_key', ''],
|
|
|
['store_id', ''],
|
|
|
['supplier_id', ''],
|
|
|
+ ['plat_type', -1],
|
|
|
['ids', '']
|
|
|
]);
|
|
|
$type = $where_tmp['export_type'];
|
|
|
- unset($where_tmp['export_type']);
|
|
|
+ unset($where_tmp['export_type']);
|
|
|
$with = [];
|
|
|
if ($where_tmp['ids']) {
|
|
|
$where['id'] = explode(',', $where_tmp['ids']);
|
|
|
@@ -332,17 +333,22 @@ class ExportExcel extends AuthController
|
|
|
$where['shipping_type'] = 1;
|
|
|
$where['pid'] = 0;
|
|
|
$with = ['pink', 'refund' => function ($query) {
|
|
|
- $query->whereIn('refund_type', [1, 2, 4, 5])->where('is_cancel', 0)->where('is_del', 0)->field('id,store_order_id');
|
|
|
- }];
|
|
|
+ $query->whereIn('refund_type', [1, 2, 4, 5])->where('is_cancel', 0)->where('is_del', 0)->field('id,store_order_id');
|
|
|
+ }];
|
|
|
}
|
|
|
if (!$where_tmp['ids'] && !$type) {
|
|
|
unset($where_tmp['ids']);
|
|
|
$where = $where_tmp;
|
|
|
}
|
|
|
$where['is_system_del'] = 0;
|
|
|
- $where['plat_type'] = $where_tmp['plat_type'];
|
|
|
- $where['store_id'] = $where_tmp['store_id'];
|
|
|
- $where['supplier_id'] = $where_tmp['supplier_id'];
|
|
|
+ $where['plat_type'] = $where_tmp['plat_type'];
|
|
|
+ $where['store_id'] = $where_tmp['store_id'];
|
|
|
+ $where['supplier_id'] = $where_tmp['supplier_id'];
|
|
|
+ if ($where['store_id'] || $where['supplier_id'] || in_array($where['plat_type'], [0, 1, 2])) {
|
|
|
+ $where['pid'] = 0;
|
|
|
+ } elseif (!in_array($where['status'], [-1, -2, -3])) {
|
|
|
+ $where['pid'] = [0, -1];
|
|
|
+ }
|
|
|
$data = $services->getExportList($where, $with, $this->service->limit);
|
|
|
return $this->success($this->service->storeOrder($data, $type));
|
|
|
}
|
|
|
@@ -502,6 +508,7 @@ class ExportExcel extends AuthController
|
|
|
$data = $services->getList($where);
|
|
|
return $this->success($this->service->SupplierFinanceRecord($data['list'] ?? []));
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 发票导出
|
|
|
* @param StoreOrderInvoiceServices $services
|
|
|
@@ -521,21 +528,21 @@ class ExportExcel extends AuthController
|
|
|
return $this->success($this->service->invoiceRecord($data['list'] ?? []));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 系统表单收集数据导出
|
|
|
- * @param SystemFormDataServices $systemFormDataServices
|
|
|
- * @param $id
|
|
|
- * @return mixed
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\DbException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException'
|
|
|
- */
|
|
|
- public function systemFormDataExport(SystemFormDataServices $systemFormDataServices, $id)
|
|
|
- {
|
|
|
- $where = $this->request->postMore([
|
|
|
- ['data', '', '', 'time']
|
|
|
- ]);
|
|
|
- $data = $systemFormDataServices->getFormDataList((int)$id, $where);
|
|
|
- return $this->success($this->service->systemFormData($data['list'] ?? []));
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 系统表单收集数据导出
|
|
|
+ * @param SystemFormDataServices $systemFormDataServices
|
|
|
+ * @param $id
|
|
|
+ * @return mixed
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException'
|
|
|
+ */
|
|
|
+ public function systemFormDataExport(SystemFormDataServices $systemFormDataServices, $id)
|
|
|
+ {
|
|
|
+ $where = $this->request->postMore([
|
|
|
+ ['data', '', '', 'time']
|
|
|
+ ]);
|
|
|
+ $data = $systemFormDataServices->getFormDataList((int)$id, $where);
|
|
|
+ return $this->success($this->service->systemFormData($data['list'] ?? []));
|
|
|
+ }
|
|
|
}
|