Merge branch 'feature/crmadmin0724' into develop
This commit is contained in:
@@ -44,14 +44,10 @@ class CustomerController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function export(Request $request)
|
public function export(Request $request)
|
||||||
{
|
{
|
||||||
set_time_limit(300);
|
|
||||||
try {
|
try {
|
||||||
$param = $request->all();
|
$param = $request->all();
|
||||||
// $corp = Corp::where(['abbr' => $request->basic_data['corp_abbr']])->first();
|
// $corp = Corp::where(['abbr' => $request->basic_data['corp_abbr']])->first();
|
||||||
// $param['corp_abbr'] = $corp->id;
|
// $param['corp_abbr'] = $corp->id;
|
||||||
if(empty($param['user_id']) && empty($param['tag_id'])){
|
|
||||||
return $this->error('请勿一次性下载所有数据,请筛选后下载需要的数据');
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = (new CustomerService())->export($param);
|
$result = (new CustomerService())->export($param);
|
||||||
$excelContent = file_get_contents($result['filepath']);
|
$excelContent = file_get_contents($result['filepath']);
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ class CustomerService
|
|||||||
|
|
||||||
if (!empty($user_id)) {
|
if (!empty($user_id)) {
|
||||||
$query->whereIn('user_id', explode(',', $user_id));
|
$query->whereIn('user_id', explode(',', $user_id));
|
||||||
|
} elseif ($user_id === 0 && $export) {
|
||||||
|
$query->where('user_id', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($tagId)) {
|
if (!empty($tagId)) {
|
||||||
@@ -137,6 +139,9 @@ class CustomerService
|
|||||||
|
|
||||||
public function export($params)
|
public function export($params)
|
||||||
{
|
{
|
||||||
|
if(empty($param['user_id']) && empty($param['tag_id'])){
|
||||||
|
$params['user_id'] = 0;
|
||||||
|
}
|
||||||
$customers = $this->search($params, true);
|
$customers = $this->search($params, true);
|
||||||
|
|
||||||
// 创建新的Spreadsheet对象
|
// 创建新的Spreadsheet对象
|
||||||
|
|||||||
Reference in New Issue
Block a user