Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
406eb26c
ShopXO
项目概览
jcy2004x
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
406eb26c
编写于
9月 08, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cj
上级
8536186e
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
55 addition
and
65 deletion
+55
-65
application/admin/controller/Index.php
application/admin/controller/Index.php
+6
-6
application/admin/view/default/index/init.html
application/admin/view/default/index/init.html
+12
-12
application/service/GoodsService.php
application/service/GoodsService.php
+11
-11
application/service/StatisticalService.php
application/service/StatisticalService.php
+4
-3
extend/base/Excel.php
extend/base/Excel.php
+21
-32
public/static/admin/default/css/index.init.css
public/static/admin/default/css/index.init.css
+1
-1
未找到文件。
application/admin/controller/Index.php
浏览文件 @
406eb26c
...
...
@@ -86,19 +86,19 @@ class Index extends Common
$order_complete_money
=
StatisticalService
::
OrderCompleteMoneyYesterdayTodayTotal
();
$this
->
assign
(
'order_complete_money'
,
$order_complete_money
[
'data'
]);
// 近30日成交金额走势
// 近30日
订单
成交金额走势
$order_profit_chart
=
StatisticalService
::
OrderProfitSevenTodayTotal
();
$this
->
assign
(
'order_profit_chart'
,
$order_profit_chart
[
'data'
]);
// 近
15
日订单交易走势
// 近
30
日订单交易走势
$order_trading_trend
=
StatisticalService
::
OrderTradingTrendSevenTodayTotal
();
$this
->
assign
(
'order_trading_trend'
,
$order_trading_trend
[
'data'
]);
// 近
15日订单
支付方式
$
order_type_number
=
StatisticalService
::
Order
PayTypeSevenTodayTotal
();
$this
->
assign
(
'
order_type_number'
,
$order
_type_number
[
'data'
]);
// 近
30日
支付方式
$
pay_type_number
=
StatisticalService
::
PayTypeSevenTodayTotal
();
$this
->
assign
(
'
pay_type_number'
,
$pay
_type_number
[
'data'
]);
// 近
15
日热销商品
// 近
30
日热销商品
$goods_hot_sale
=
StatisticalService
::
GoodsHotSaleSevenTodayTotal
();
$this
->
assign
(
'goods_hot_sale'
,
$goods_hot_sale
[
'data'
]);
...
...
application/admin/view/default/index/init.html
浏览文件 @
406eb26c
...
...
@@ -73,11 +73,11 @@
</ul>
</div>
<!-- 近30日成交金额走势 -->
<!-- 近30日
订单
成交金额走势 -->
<div
class=
"echarts-container"
>
<div
class=
"echarts-title"
>
<span
class=
"icon"
></span>
<span
class=
"title"
>
近30日成交金额走势
</span>
<span
class=
"title"
>
近30日
订单
成交金额走势
</span>
</div>
<div
id=
"echarts-order-profit"
></div>
</div>
...
...
@@ -103,12 +103,12 @@
</li>
<li>
<!-- 近30日
订单
支付方式 -->
<!-- 近30日支付方式 -->
<div
class=
"echarts-title"
>
<span
class=
"icon"
></span>
<span
class=
"title"
>
近30日
订单
支付方式
</span>
<span
class=
"title"
>
近30日支付方式
</span>
</div>
<div
id=
"echarts-
order-
pay-type"
></div>
<div
id=
"echarts-pay-type"
></div>
</li>
</ul>
...
...
@@ -167,7 +167,7 @@
<script
type=
"text/javascript"
>
$
(
function
()
{
// 近30日成交金额走势
// 近30日
订单
成交金额走势
var
order_profit_chart
=
echarts
.
init
(
document
.
getElementById
(
'
echarts-order-profit
'
),
'
macarons
'
);
var
option
=
{
tooltip
:
{
...
...
@@ -306,14 +306,14 @@ $(function()
};
goods_hot_chart
.
setOption
(
option
);
// 近30日
订单
支付方式
var
order_pay_type_chart
=
echarts
.
init
(
document
.
getElementById
(
'
echarts-
order-
pay-type
'
),
'
macarons
'
);
// 近30日支付方式
var
order_pay_type_chart
=
echarts
.
init
(
document
.
getElementById
(
'
echarts-pay-type
'
),
'
macarons
'
);
var
option
=
{
tooltip
:
{
trigger
:
'
axis
'
},
legend
:
{
data
:
{{:
json_encode
(
$
order
_type_number
.
title_arr
)}}
data
:
{{:
json_encode
(
$
pay
_type_number
.
title_arr
)}}
},
toolbox
:
{
show
:
{{
if
IsMobile
()}}
false
{{
else
}}
true
{{
/
if
}},
...
...
@@ -322,7 +322,7 @@ $(function()
dataView
:
{
show
:
true
,
readOnly
:
false
},
magicType
:
{
show
:
true
,
type
:
[
'
line
'
,
'
bar
'
]},
restore
:
{
show
:
false
},
saveAsImage
:
{
name
:
'
近30日
订单
支付方式
'
,
show
:
true
}
saveAsImage
:
{
name
:
'
近30日支付方式
'
,
show
:
true
}
}
},
calculable
:
true
,
...
...
@@ -330,7 +330,7 @@ $(function()
{
type
:
'
category
'
,
boundaryGap
:
false
,
data
:
{{:
json_encode
(
$
order
_type_number
.
name_arr
)}}
data
:
{{:
json_encode
(
$
pay
_type_number
.
name_arr
)}}
}
],
yAxis
:
[
...
...
@@ -338,7 +338,7 @@ $(function()
type
:
'
value
'
}
],
series
:
{{:
json_encode
(
$
order
_type_number
.
data
)}}
series
:
{{:
json_encode
(
$
pay
_type_number
.
data
)}}
};
order_pay_type_chart
.
setOption
(
option
);
...
...
application/service/GoodsService.php
浏览文件 @
406eb26c
...
...
@@ -142,7 +142,7 @@ class GoodsService
* @desc description
* @param [array] $data [商品分类数据 二维数组]
*/
p
rivate
static
function
GoodsCategoryDataDealWith
(
$data
)
p
ublic
static
function
GoodsCategoryDataDealWith
(
$data
)
{
if
(
!
empty
(
$data
)
&&
is_array
(
$data
))
{
...
...
@@ -1064,7 +1064,7 @@ class GoodsService
* @param [array] $params [输入参数]
* @param [int] $goods_id [商品id]
*/
p
rivate
static
function
GoodsParametersInsert
(
$params
,
$goods_id
)
p
ublic
static
function
GoodsParametersInsert
(
$params
,
$goods_id
)
{
// 删除商品参数
Db
::
name
(
'GoodsParams'
)
->
where
([
'goods_id'
=>
$goods_id
])
->
delete
();
...
...
@@ -1107,7 +1107,7 @@ class GoodsService
* @param [array] $params [输入参数]
* @param [int] $goods_id [商品id]
*/
p
rivate
static
function
GoodsSaveBaseUpdate
(
$params
,
$goods_id
)
p
ublic
static
function
GoodsSaveBaseUpdate
(
$params
,
$goods_id
)
{
$data
=
Db
::
name
(
'GoodsSpecBase'
)
->
field
(
'min(price) AS min_price, max(price) AS max_price, sum(inventory) AS inventory, min(original_price) AS min_original_price, max(original_price) AS max_original_price'
)
->
where
([
'goods_id'
=>
$goods_id
])
->
find
();
if
(
empty
(
$data
))
...
...
@@ -1139,7 +1139,7 @@ class GoodsService
* @desc description
* @param [array] $params [输入参数]
*/
p
rivate
static
function
GetFormGoodsSpecificationsParams
(
$params
=
[])
p
ublic
static
function
GetFormGoodsSpecificationsParams
(
$params
=
[])
{
$data
=
[];
$title
=
[];
...
...
@@ -1311,7 +1311,7 @@ class GoodsService
* @desc description
* @param [array] $params [输入参数]
*/
p
rivate
static
function
GetFormGoodsSpecificationsBaseParams
(
$params
=
[])
p
ublic
static
function
GetFormGoodsSpecificationsBaseParams
(
$params
=
[])
{
$result
=
[];
foreach
(
$params
as
$k
=>
$v
)
...
...
@@ -1338,7 +1338,7 @@ class GoodsService
* @param [array] $params [输入参数]
* @return [array] [一维数组但图片地址]
*/
p
rivate
static
function
GetFormGoodsPhotoParams
(
$params
=
[])
p
ublic
static
function
GetFormGoodsPhotoParams
(
$params
=
[])
{
if
(
empty
(
$params
[
'photo'
]))
{
...
...
@@ -1365,7 +1365,7 @@ class GoodsService
* @desc description
* @param [array] $params [输入参数]
*/
p
rivate
static
function
GetFormGoodsContentAppParams
(
$params
=
[])
p
ublic
static
function
GetFormGoodsContentAppParams
(
$params
=
[])
{
// 开始处理
$result
=
[];
...
...
@@ -1399,7 +1399,7 @@ class GoodsService
* @param [int] $goods_id [商品id]
* @return [array] [boolean | msg]
*/
p
rivate
static
function
GoodsCategoryInsert
(
$data
,
$goods_id
)
p
ublic
static
function
GoodsCategoryInsert
(
$data
,
$goods_id
)
{
Db
::
name
(
'GoodsCategoryJoin'
)
->
where
([
'goods_id'
=>
$goods_id
])
->
delete
();
if
(
!
empty
(
$data
))
...
...
@@ -1431,7 +1431,7 @@ class GoodsService
* @param [int] $goods_id [商品id]
* @return [array] [boolean | msg]
*/
p
rivate
static
function
GoodsContentAppInsert
(
$data
,
$goods_id
)
p
ublic
static
function
GoodsContentAppInsert
(
$data
,
$goods_id
)
{
Db
::
name
(
'GoodsContentApp'
)
->
where
([
'goods_id'
=>
$goods_id
])
->
delete
();
if
(
!
empty
(
$data
))
...
...
@@ -1465,7 +1465,7 @@ class GoodsService
* @param [int] $goods_id [商品id]
* @return [array] [boolean | msg]
*/
p
rivate
static
function
GoodsPhotoInsert
(
$data
,
$goods_id
)
p
ublic
static
function
GoodsPhotoInsert
(
$data
,
$goods_id
)
{
Db
::
name
(
'GoodsPhoto'
)
->
where
([
'goods_id'
=>
$goods_id
])
->
delete
();
if
(
!
empty
(
$data
))
...
...
@@ -1499,7 +1499,7 @@ class GoodsService
* @param [int] $goods_id [商品id]
* @return [array] [boolean | msg]
*/
p
rivate
static
function
GoodsSpecificationsInsert
(
$data
,
$goods_id
)
p
ublic
static
function
GoodsSpecificationsInsert
(
$data
,
$goods_id
)
{
// 删除原来的数据
Db
::
name
(
'GoodsSpecType'
)
->
where
([
'goods_id'
=>
$goods_id
])
->
delete
();
...
...
application/service/StatisticalService.php
浏览文件 @
406eb26c
...
...
@@ -413,21 +413,22 @@ class StatisticalService
}
/**
*
订单
支付方式, 30天数据
* 支付方式, 30天数据
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
* @param [array] $params [输入参数]
*/
public
static
function
Order
PayTypeSevenTodayTotal
(
$params
=
[])
public
static
function
PayTypeSevenTodayTotal
(
$params
=
[])
{
// 初始化
self
::
Init
(
$params
);
// 获取支付方式名称
$where
=
[
[
'business_type'
,
'='
,
1
],
[
'business_type'
,
'<>'
,
''
],
[
'status'
,
'='
,
1
],
];
$pay_name_arr
=
Db
::
name
(
'PayLog'
)
->
where
(
$where
)
->
group
(
'payment_name'
)
->
column
(
'payment_name'
);
...
...
extend/base/Excel.php
浏览文件 @
406eb26c
...
...
@@ -29,6 +29,7 @@ class Excel
private
$horizontal_center
;
private
$vertical_center
;
private
$warap_text
;
private
$writer_type
;
/**
* [__construct 构造方法]
...
...
@@ -79,6 +80,9 @@ class Excel
// 内容自动换行
$this
->
warap_text
=
isset
(
$params
[
'warap_text'
])
?
intval
(
$params
[
'warap_text'
])
:
1
;
// excel写入类型
$this
->
writer_type
=
empty
(
$params
[
'writer_type'
])
?
'Excel2007'
:
teim
(
$params
[
'writer_type'
]);
// 引入PHPExcel类库
require
ROOT
.
'extend'
.
DS
.
'phpexcel'
.
DS
.
'PHPExcel.php'
;
}
...
...
@@ -117,7 +121,7 @@ class Excel
// 默认EXCEL
default
:
$writer
=
\
PHPExcel_IOFactory
::
createWriter
(
$excel
,
'Excel5'
);
$writer
=
\
PHPExcel_IOFactory
::
createWriter
(
$excel
,
$this
->
writer_type
);
}
// 获取配置编码类型
...
...
@@ -220,21 +224,14 @@ class Excel
public
function
Import
(
$file
=
''
)
{
// 文件为空则取全局文变量excel的临时文件
if
(
empty
(
$file
)
&&
!
empty
(
$_FILES
[
'excel'
][
'tmp_name'
]
))
if
(
empty
(
$file
)
&&
(
empty
(
$_FILES
[
'file'
])
||
empty
(
$_FILES
[
'file'
][
'tmp_name'
])
))
{
$file
=
$_FILES
[
'excel'
][
'tmp_name'
];
}
// 文件地址是否有误,title数据是否有数据
if
(
empty
(
$file
)
||
empty
(
$this
->
title
))
{
echo
'<script>alert("'
.
$this
->
msg
.
'");</script>'
;
echo
'<script>window.location.href="'
.
$this
->
jump_url
.
'"</script>'
;
die
;
return
DataReturn
(
'文件为空'
,
-
1
);
}
$file
=
empty
(
$file
)
?
$_FILES
[
'file'
][
'tmp_name'
]
:
$file
;
// 取得文件基础数据
$reader
=
\
PHPExcel_IOFactory
::
createReader
(
'Excel5'
);
$reader
=
\
PHPExcel_IOFactory
::
createReader
(
$this
->
writer_type
);
$excel
=
$reader
->
load
(
$file
);
// 取得总行数
...
...
@@ -250,42 +247,34 @@ class Excel
$highest_column_index
=
\
PHPExcel_Cell
::
columnIndexFromString
(
$highest_column
);
// 定义变量
$
result
=
[];
$
field
=
[];
$
data
=
[];
$
title
=
[];
// 读取数据
for
(
$row
=
1
;
$row
<=
$highest_row
;
$row
++
)
{
// 临时数据
$info
=
[];
// 注意 highest_column_index 的列数索引从0开始
$info
=
[];
for
(
$col
=
0
;
$col
<
$highest_column_index
;
$col
++
)
{
$value
=
$worksheet
->
getCellByColumnAndRow
(
$col
,
$row
)
->
getFormattedValue
(
);
$value
=
trim
(
$worksheet
->
getCellByColumnAndRow
(
$col
,
$row
)
->
getFormattedValue
()
);
if
(
$row
==
1
)
{
foreach
(
$this
->
title
as
$tk
=>
$tv
)
{
if
(
$value
==
$tv
[
'name'
])
{
$tv
[
'field'
]
=
$tk
;
$field
[
$col
]
=
$tv
;
}
}
$title
[]
=
$value
;
}
else
{
if
(
!
empty
(
$field
))
{
$info
[
$field
[
$col
][
'field'
]]
=
(
$field
[
$col
][
'type'
]
==
'int'
)
?
trim
(
ScienceNumToString
(
$value
))
:
trim
(
$value
);
}
$info
[]
=
$value
;
}
}
if
(
$row
>
1
)
{
$
result
[]
=
$info
;
$
data
[]
=
$info
;
}
}
return
$result
;
$result
=
[
'title'
=>
$title
,
'data'
=>
$data
,
];
return
DataReturn
(
'处理成功'
,
0
,
$result
);
}
}
?>
\ No newline at end of file
public/static/admin/default/css/index.init.css
浏览文件 @
406eb26c
...
...
@@ -136,7 +136,7 @@ html, body {
/**
* 支付方式
*/
#echarts-
order-
pay-type
{
#echarts-pay-type
{
margin-top
:
10px
;
height
:
400px
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录