切换导航条
此项目
正在载入...
登录
李忠强
/
temporaryfood
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
SHW\戥岁。。
3 years ago
提交
1fa2433766b65e356511d1f117707926e8124b61
1 个父辈
593ea8f1
加入购物车
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
30 行增加
和
26 行删除
application/admin/controller/litestore/Litestoregoods.php
application/api/controller/Classification.php
application/config.php
application/admin/controller/litestore/Litestoregoods.php
查看文件 @
1fa2433
...
...
@@ -3,6 +3,7 @@
namespace
app\admin\controller\litestore
;
use
app\admin\model\litestore\Litestoregoodsspec
;
use
app\api\model\Goods
;
use
app\common\controller\Backend
;
use
app\admin\model\litestore\Litestorespec
as
SpecModel
;
use
app\admin\model\litestore\Litestorespecvalue
as
SpecValueModel
;
...
...
@@ -272,16 +273,23 @@ class Litestoregoods extends Backend
/**
* 导出
*/
public
function
clubpeople
(){
//1.从数据库中导出需要进行要导出的数据
$list
=
Db
::
query
(
'SELECT stu_list.stu_name,stu_list.stu_department,stu_list.stu_phone,stu_list.stu_email,stu_list.stu_profess
,club_branch.* FROM club_branch INNER JOIN stu_list ON club_branch.stu_number = stu_list.stu_number
where club_branch.club_id=:acc order by club_branch.club_branch_name '
,[
'acc'
=>
$clubid
]);
public
function
clubpeople
()
{
//1.从数据库中导出需要进行要导出的数据
// $list = Db::query('SELECT stu_list.stu_name,stu_list.stu_department,stu_list.stu_phone,stu_list.stu_email,stu_list.stu_profess
// ,club_branch.* FROM club_branch INNER JOIN stu_list ON club_branch.stu_number = stu_list.stu_number
// where club_branch.club_id=:acc order by club_branch.club_branch_name ', ['acc' => $clubid]);
$goods
=
new
Goods
();
$list
=
$goods
->
select
()
->
each
(
function
(
&
$item
){
// $;
});
if
(
empty
(
$list
)){
$this
->
error
(
'没有可导出的数据'
);
}
// foreach ()
//重要补助
//重要补助
//2.加载PHPExcle类库
vendor
(
'PHPExcel.PHPExcel'
);
//3.实例化PHPExcel类
...
...
@@ -308,29 +316,29 @@ class Litestoregoods extends Backend
$objPHPExcel
->
setActiveSheetIndex
(
0
)
->
getColumnDimension
(
'E'
)
->
setWidth
(
20
);
$objPHPExcel
->
setActiveSheetIndex
(
0
)
->
getColumnDimension
(
'F'
)
->
setWidth
(
30
);
for
(
$i
=
0
;
$i
<
count
(
$list
);
$i
++
){
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'A'
.
(
$i
+
2
),
$list
[
$i
][
'club_branch_name'
]);
//ID
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'B'
.
(
$i
+
2
),
$list
[
$i
][
'club_position'
]);
//标签码
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'C'
.
(
$i
+
2
),
$list
[
$i
][
'stu_number'
]);
//防伪码
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'D'
.
(
$i
+
2
),
$list
[
$i
][
'stu_name'
]);
//ID
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'E'
.
(
$i
+
2
),
$list
[
$i
][
'stu_phone'
]);
//标签码
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'F'
.
(
$i
+
2
),
$list
[
$i
][
'stu_email'
]);
//ID
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'G'
.
(
$i
+
2
),
$list
[
$i
][
'stu_department'
]);
//标签码
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'H'
.
(
$i
+
2
),
$list
[
$i
][
'stu_profess'
]);
//防伪码
for
(
$i
=
0
;
$i
<
count
(
$list
);
$i
++
)
{
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'A'
.
(
$i
+
2
),
$list
[
$i
][
'club_branch_name'
]);
//ID
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'B'
.
(
$i
+
2
),
$list
[
$i
][
'club_position'
]);
//标签码
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'C'
.
(
$i
+
2
),
$list
[
$i
][
'stu_number'
]);
//防伪码
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'D'
.
(
$i
+
2
),
$list
[
$i
][
'stu_name'
]);
//ID
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'E'
.
(
$i
+
2
),
$list
[
$i
][
'stu_phone'
]);
//标签码
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'F'
.
(
$i
+
2
),
$list
[
$i
][
'stu_email'
]);
//ID
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'G'
.
(
$i
+
2
),
$list
[
$i
][
'stu_department'
]);
//标签码
$objPHPExcel
->
getActiveSheet
()
->
setCellValue
(
'H'
.
(
$i
+
2
),
$list
[
$i
][
'stu_profess'
]);
//防伪码
}
//7.设置保存的Excel表格名称
$filename
=
$club_name
.
'人员名单'
.
date
(
'ymd'
,
time
())
.
'.xls'
;
$filename
=
$club_name
.
'人员名单'
.
date
(
'ymd'
,
time
())
.
'.xls'
;
//8.设置当前激活的sheet表格名称;
$objPHPExcel
->
getActiveSheet
()
->
setTitle
(
'人员名单'
);
//9.设置浏览器窗口下载表格
header
(
"Content-Type: application/force-download"
);
header
(
"Content-Type: application/octet-stream"
);
header
(
"Content-Type: application/download"
);
header
(
'Content-Disposition:inline;filename="'
.
$filename
.
'"'
);
header
(
'Content-Disposition:inline;filename="'
.
$filename
.
'"'
);
//生成excel文件
$objWriter
=
\PHPExcel_IOFactory
::
createWriter
(
$objPHPExcel
,
'Excel5'
);
//下载文件在浏览器窗口
$objWriter
->
save
(
'php://output'
);
exit
;
}
}
}
...
...
application/api/controller/Classification.php
查看文件 @
1fa2433
...
...
@@ -408,10 +408,6 @@ class Classification extends Api
->
where
(
'user_id'
,
$this
->
auth
->
id
)
->
where
(
'goods_id'
,
$item
[
'goods_id'
])
->
sum
(
'number'
);
// $item['goods_cart_id'] = Db::name('cart')
// ->where('user_id', $this->auth->id)
// ->where('goods_id', $item['goods_id'])
// ->value('id');
}
else
{
$item
[
'cart_number'
]
=
0
;
}
...
...
application/config.php
查看文件 @
1fa2433
...
...
@@ -242,7 +242,7 @@ return [
// 验证码位数
'length'
=>
4
,
// 验证成功后是否重置
'reset'
=>
true
'reset'
=>
true
,
],
// +----------------------------------------------------------------------
// | Token设置
...
...
@@ -290,7 +290,7 @@ return [
//插件纯净模式,插件启用后是否删除插件目录的application、public和assets文件夹
'addon_pure_mode'
=>
true
,
//允许跨域的域名,多个以,分隔
'cors_request_domain'
=>
'localhost,127.0.0.1'
,
'cors_request_domain'
=>
'localhost,127.0.0.1
,http://temporaryfood.n.broing.cn
'
,
//版本号
'version'
=>
'1.2.2.20211011_beta'
,
//API接口地址
...
...
请
注册
或
登录
后发表评论