Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2a7ddcec
authored
Mar 19, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
自营样片导出添加字段
parent
044bd655
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
app/Http/Controllers/ExportController.php
app/Http/Controllers/ExportController.php
View file @
2a7ddcec
...
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use
Illuminate\Http\Request
;
use
App\Http\Controllers\Controller
;
use
App\Model\UserSampleApplyModel
;
use
App\Model\UserSampleInviteModel
;
use
DB
;
use
Excel
;
...
...
@@ -19,6 +20,7 @@ Class ExportController extends Controller
public
function
selfSampleExport
(
$request
)
{
$UserSampleApplyModel
=
new
UserSampleApplyModel
();
$UserSampleInviteModel
=
new
UserSampleInviteModel
();
$data
=
$UserSampleApplyModel
->
lists
(
$request
,
1
);
foreach
(
$data
as
$k
=>
$v
)
{
...
...
@@ -31,10 +33,19 @@ Class ExportController extends Controller
$cellData
[
$k
][
'order_sn'
]
=
$v
[
'order_sn'
];
$cellData
[
$k
][
'goods_id'
]
=
$v
[
'goods_id'
];
$cellData
[
$k
][
'goods_name'
]
=
$v
[
'goods_name'
];
$cellData
[
$k
][
'create_time'
]
=
$v
[
'create_time'
];
$invite
=
$UserSampleInviteModel
->
where
(
'user_id'
,
$v
[
'user_id'
])
->
select
(
'invitee_mobile'
)
->
get
()
->
toArray
();
if
(
!
empty
(
$invite
))
{
$cellData
[
$k
][
'invitee'
]
=
implode
(
','
,
array_column
(
$invite
,
'invitee_mobile'
));
}
else
{
$cellData
[
$k
][
'invitee'
]
=
''
;
}
$cellData
[
$k
][
'create_time'
]
=
$v
[
'create_time'
];
}
$headerCell
=
[
'用户ID'
,
'用户账户'
,
'邀请人数'
,
'已申请样片数'
,
'剩余领取次数'
,
'订单ID'
,
'订单编号'
,
'样片ID'
,
'样片名称'
,
'最近一次领取时间'
];
$headerCell
=
[
'用户ID'
,
'用户账户'
,
'邀请人数'
,
'已申请样片数'
,
'剩余领取次数'
,
'订单ID'
,
'订单编号'
,
'样片ID'
,
'样片名称'
,
'
邀请用户'
,
'
最近一次领取时间'
];
$fileName
=
'自营样片领取记录导出'
.
date
(
'_YmdHis'
);
$sheetName
=
'自营样片'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment