Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
e2038f62
ShopXO
项目概览
jamesyang1999
/
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,发现更多精彩内容 >>
提交
e2038f62
编写于
4月 18, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应用
上级
19723978
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
152 addition
and
38 deletion
+152
-38
application/plugins/petscms/Petsadmin.php
application/plugins/petscms/Petsadmin.php
+43
-3
application/plugins/petscms/Service.php
application/plugins/petscms/Service.php
+78
-10
application/plugins/view/petscms/pets/index.html
application/plugins/view/petscms/pets/index.html
+5
-4
application/plugins/view/petscms/pets/saveinfo.html
application/plugins/view/petscms/pets/saveinfo.html
+1
-1
application/plugins/view/petscms/petsadmin/help.html
application/plugins/view/petscms/petsadmin/help.html
+1
-1
application/plugins/view/petscms/petsadmin/index.html
application/plugins/view/petscms/petsadmin/index.html
+12
-7
application/plugins/view/petscms/petsadmin/saveinfo.html
application/plugins/view/petscms/petsadmin/saveinfo.html
+1
-1
public/static/common/css/common.css
public/static/common/css/common.css
+3
-0
public/static/plugins/css/petscms/pets.css
public/static/plugins/css/petscms/pets.css
+4
-6
public/static/plugins/css/petscms/petsadmin.css
public/static/plugins/css/petscms/petsadmin.css
+4
-5
未找到文件。
application/plugins/petscms/Petsadmin.php
浏览文件 @
e2038f62
...
...
@@ -49,7 +49,7 @@ class PetsAdmin extends Controller
'total'
=>
$total
,
'where'
=>
$params
,
'page'
=>
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
,
'url'
=>
Plugins
HomeUrl
(
'petscms'
,
'pets
'
,
'index'
),
'url'
=>
Plugins
AdminUrl
(
'petscms'
,
'petsadmin
'
,
'index'
),
);
$page
=
new
\
base\Page
(
$page_params
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
...
...
@@ -152,7 +152,45 @@ class PetsAdmin extends Controller
}
// 用户
return
Service
::
PestSave
(
$params
);
return
Service
::
PetsSave
(
$params
);
}
/**
* 宠物解绑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-15T11:03:30+0800
*/
public
function
untying
(
$params
=
[])
{
// 是否ajax
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始操作
return
Service
::
PetsUntying
(
$params
);
}
/**
* 宠物删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-15T11:03:30+0800
*/
public
function
delete
(
$params
=
[])
{
// 是否ajax
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始操作
return
Service
::
PetsDelete
(
$params
);
}
/**
...
...
@@ -188,7 +226,7 @@ class PetsAdmin extends Controller
'total'
=>
$total
,
'where'
=>
$params
,
'page'
=>
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
,
'url'
=>
Plugins
HomeUrl
(
'petscms'
,
'pets
'
,
'index'
),
'url'
=>
Plugins
AdminUrl
(
'petscms'
,
'petsadmin
'
,
'index'
),
);
$page
=
new
\
base\Page
(
$page_params
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
...
...
@@ -200,7 +238,9 @@ class PetsAdmin extends Controller
'where'
=>
$where
,
);
$data
=
Service
::
HelpList
(
$data_params
);
unset
(
$params
[
'pets_id'
]);
$this
->
assign
(
'data_list'
,
$data
[
'data'
]);
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
(
'../../../plugins/view/petscms/petsadmin/help'
);
}
...
...
application/plugins/petscms/Service.php
浏览文件 @
e2038f62
...
...
@@ -64,7 +64,7 @@ class Service
$where
=
empty
(
$params
[
'where'
])
?
[]
:
$params
[
'where'
];
$m
=
isset
(
$params
[
'm'
])
?
intval
(
$params
[
'm'
])
:
0
;
$n
=
isset
(
$params
[
'n'
])
?
intval
(
$params
[
'n'
])
:
10
;
$order_by
=
empty
(
$params
[
'order_by'
])
?
'id desc'
:
$params
[
'order_by'
];
$order_by
=
empty
(
$params
[
'order_by'
])
?
'
status asc,
id desc'
:
$params
[
'order_by'
];
// 获取数据列表
$data
=
Db
::
name
(
'PluginsPetscmsPets'
)
->
where
(
$where
)
->
limit
(
$m
,
$n
)
->
order
(
$order_by
)
->
select
();
...
...
@@ -76,13 +76,13 @@ class Service
$v
[
'type_name'
]
=
empty
(
$v
[
'type'
])
?
''
:
self
::
$pets_attribute_type_list
[
$v
[
'type'
]][
'name'
];
// 性别
$v
[
'gender_name'
]
=
self
::
$pets_attribute_gender_list
[
$v
[
'gender'
]][
'name'
];
$v
[
'gender_name'
]
=
(
$v
[
'gender'
]
==
-
1
)
?
''
:
self
::
$pets_attribute_gender_list
[
$v
[
'gender'
]][
'name'
];
// 是否绝育
$v
[
'sterilization_name'
]
=
self
::
$pets_attribute_is_text_list
[
$v
[
'sterilization'
]][
'name'
];
$v
[
'sterilization_name'
]
=
(
$v
[
'sterilization'
]
==
-
1
)
?
''
:
self
::
$pets_attribute_is_text_list
[
$v
[
'sterilization'
]][
'name'
];
// 是否疫苗
$v
[
'vaccine_name'
]
=
self
::
$pets_attribute_is_text_list
[
$v
[
'vaccine'
]][
'name'
];
$v
[
'vaccine_name'
]
=
(
$v
[
'vaccine'
]
==
-
1
)
?
''
:
self
::
$pets_attribute_is_text_list
[
$v
[
'vaccine'
]][
'name'
];
// 状态
$v
[
'status_name'
]
=
self
::
$pets_attribute_status_list
[
$v
[
'status'
]][
'name'
];
...
...
@@ -102,7 +102,7 @@ class Service
$v
[
'content'
]
=
ResourcesService
::
ContentStaticReplace
(
$v
[
'content'
],
'get'
);
// 相册
$v
[
'photo'
]
=
empty
(
$v
[
'photo'
])
?
null
:
self
::
GetPe
st
PhotoHandle
(
$v
[
'photo'
]);
$v
[
'photo'
]
=
empty
(
$v
[
'photo'
])
?
null
:
self
::
GetPe
ts
PhotoHandle
(
$v
[
'photo'
]);
// 丢失时间
$v
[
'lose_time_name'
]
=
empty
(
$v
[
'lose_time'
])
?
''
:
date
(
'Y-m-d'
,
$v
[
'lose_time'
]);
...
...
@@ -138,7 +138,7 @@ class Service
* @datetime 2019-04-11T22:56:49+0800
* @param [array] $photo [相册数据]
*/
private
static
function
GetPe
st
PhotoHandle
(
$photo
)
private
static
function
GetPe
ts
PhotoHandle
(
$photo
)
{
$result
=
[];
if
(
!
empty
(
$photo
))
...
...
@@ -241,7 +241,7 @@ class Service
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
Pe
st
Save
(
$params
=
[])
public
static
function
Pe
ts
Save
(
$params
=
[])
{
// 请求参数
$p
=
[
...
...
@@ -359,9 +359,9 @@ class Service
'birthday'
=>
empty
(
$params
[
'birthday'
])
?
0
:
strtotime
(
$params
[
'birthday'
]),
'type'
=>
isset
(
$params
[
'type'
])
?
$params
[
'type'
]
:
''
,
'varieties'
=>
isset
(
$params
[
'varieties'
])
?
$params
[
'varieties'
]
:
''
,
'gender'
=>
isset
(
$params
[
'gender'
])
?
intval
(
$params
[
'gender'
])
:
0
,
'sterilization'
=>
isset
(
$params
[
'sterilization'
])
?
intval
(
$params
[
'sterilization'
])
:
0
,
'vaccine'
=>
isset
(
$params
[
'vaccine'
])
?
intval
(
$params
[
'vaccine'
])
:
0
,
'gender'
=>
isset
(
$params
[
'gender'
])
?
$params
[
'gender'
]
:
-
1
,
'sterilization'
=>
isset
(
$params
[
'sterilization'
])
?
$params
[
'sterilization'
]
:
-
1
,
'vaccine'
=>
isset
(
$params
[
'vaccine'
])
?
$params
[
'vaccine'
]
:
-
1
,
'photo'
=>
empty
(
$photo
[
'data'
])
?
''
:
json_encode
(
$photo
[
'data'
]),
'content'
=>
$content
,
'person_name'
=>
isset
(
$params
[
'person_name'
])
?
$params
[
'person_name'
]
:
''
,
...
...
@@ -586,5 +586,73 @@ class Service
{
return
(
int
)
Db
::
name
(
'PluginsPetscmsHelp'
)
->
where
(
$where
)
->
count
();
}
/**
* 宠物解绑
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
PetsUntying
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'操作id有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 解绑操作
if
(
Db
::
name
(
'PluginsPetscmsPets'
)
->
where
([
'id'
=>
$params
[
'id'
]])
->
update
([
'user_id'
=>
0
,
'upd_time'
=>
time
()]))
{
return
DataReturn
(
'解绑成功'
);
}
return
DataReturn
(
'解绑失败或资源不存在'
,
-
100
);
}
/**
* 宠物删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
PetsDelete
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'操作id有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 删除操作
if
(
Db
::
name
(
'PluginsPetscmsPets'
)
->
where
([
'id'
=>
$params
[
'id'
]])
->
delete
())
{
return
DataReturn
(
'删除成功'
);
}
return
DataReturn
(
'删除失败或资源不存在'
,
-
100
);
}
}
?>
\ No newline at end of file
application/plugins/view/petscms/pets/index.html
浏览文件 @
e2038f62
...
...
@@ -114,7 +114,7 @@
<th>
二维码
</th>
<th>
状态
</th>
<th
class=
"am-hide-sm-only"
>
操作时间
</th>
<th>
操作
</th>
<th
class=
"th-operation"
>
操作
</th>
</tr>
</thead>
<tbody>
...
...
@@ -142,7 +142,7 @@
类型:{{if empty($v['type_name'])}}
<span
class=
"items-value-empty"
>
未填写
</span>
{{else /}}{{$v.type_name}}{{/if}}
<br
/>
性别:{{if empty($v['gender_name'])}}
<span
class=
"items-value-empty"
>
未
填写
</span>
{{else /}}{{$v.gender_name}}{{/if}}
<br
/>
性别:{{if empty($v['gender_name'])}}
<span
class=
"items-value-empty"
>
未
设置
</span>
{{else /}}{{$v.gender_name}}{{/if}}
<br
/>
生日:{{if empty($v['birthday_name'])}}
<span
class=
"items-value-empty"
>
未填写
</span>
{{else /}}{{$v.birthday_name}}{{/if}}
<br
/>
...
...
@@ -150,8 +150,9 @@
品种:{{if empty($v['varieties'])}}
<span
class=
"items-value-empty"
>
未填写
</span>
{{else /}}{{$v.varieties}}{{/if}}
<br
/>
绝育:{{$v.sterilization_name}}
<br
/>
疫苗:{{$v.vaccine_name}}
<br
/>
绝育:{{if empty($v['sterilization_name'])}}
<span
class=
"items-value-empty"
>
未设置
</span>
{{else /}}{{$v.sterilization_name}}{{/if}}
<br
/>
疫苗:{{if empty($v['sterilization_name'])}}
<span
class=
"items-value-empty"
>
未设置
</span>
{{else /}}{{$v.sterilization_name}}{{/if}}
<br
/>
</td>
<td
class=
"am-hide-sm-only"
>
姓名:{{if empty($v['person_name'])}}
<span
class=
"items-value-empty"
>
未填写
</span>
{{else /}}{{$v.person_name}}{{/if}}
<br
/>
...
...
application/plugins/view/petscms/pets/saveinfo.html
浏览文件 @
e2038f62
...
...
@@ -177,8 +177,8 @@
<button
class=
"am-btn am-btn-default am-radius"
type=
"button"
id=
"map-location-submit"
><span
class=
"am-icon-map-marker"
></span>
定位
</button>
</span>
</div>
<div
id=
"map"
data-level=
"17"
></div>
</div>
<div
id=
"map"
data-level=
"17"
class=
"am-form-group"
></div>
</div>
<div
class=
"am-form-group"
>
...
...
application/plugins/view/petscms/petsadmin/help.html
浏览文件 @
e2038f62
...
...
@@ -5,7 +5,7 @@
<div
class=
"content"
>
<legend>
<span
class=
"fs-16"
>
宠物管理系统
</span>
<a
href=
"{{:PluginsAdminUrl('petscms', 'petsadmin', 'index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
<a
href=
"{{:PluginsAdminUrl('petscms', 'petsadmin', 'index'
, $params
)}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"petscms-content pets-help"
data-url=
"{{:PluginsAdminUrl('petscms', 'petsadmin', 'helpmap')}}"
>
...
...
application/plugins/view/petscms/petsadmin/index.html
浏览文件 @
e2038f62
...
...
@@ -101,13 +101,13 @@
<th>
二维码
</th>
<th>
状态
</th>
<th
class=
"am-hide-sm-only"
>
操作时间
</th>
<th>
操作
</th>
<th
class=
"th-operation"
>
操作
</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr>
<tr
id=
"data-list-{{$v.id}}"
>
<td
class=
"am-hide-sm-only row-first"
>
<p
class=
"ellipsis"
>
{{$v.title}}
</p>
{{if !empty($v['photo'])}}
...
...
@@ -129,7 +129,7 @@
类型:{{if empty($v['type_name'])}}
<span
class=
"items-value-empty"
>
未填写
</span>
{{else /}}{{$v.type_name}}{{/if}}
<br
/>
性别:{{if empty($v['gender_name'])}}
<span
class=
"items-value-empty"
>
未
填写
</span>
{{else /}}{{$v.gender_name}}{{/if}}
<br
/>
性别:{{if empty($v['gender_name'])}}
<span
class=
"items-value-empty"
>
未
设置
</span>
{{else /}}{{$v.gender_name}}{{/if}}
<br
/>
生日:{{if empty($v['birthday_name'])}}
<span
class=
"items-value-empty"
>
未填写
</span>
{{else /}}{{$v.birthday_name}}{{/if}}
<br
/>
...
...
@@ -137,8 +137,9 @@
品种:{{if empty($v['varieties'])}}
<span
class=
"items-value-empty"
>
未填写
</span>
{{else /}}{{$v.varieties}}{{/if}}
<br
/>
绝育:{{$v.sterilization_name}}
<br
/>
疫苗:{{$v.vaccine_name}}
<br
/>
绝育:{{if empty($v['sterilization_name'])}}
<span
class=
"items-value-empty"
>
未设置
</span>
{{else /}}{{$v.sterilization_name}}{{/if}}
<br
/>
疫苗:{{if empty($v['sterilization_name'])}}
<span
class=
"items-value-empty"
>
未设置
</span>
{{else /}}{{$v.sterilization_name}}{{/if}}
<br
/>
</td>
<td
class=
"am-hide-sm-only"
>
姓名:{{if empty($v['person_name'])}}
<span
class=
"items-value-empty"
>
未填写
</span>
{{else /}}{{$v.person_name}}{{/if}}
<br
/>
...
...
@@ -161,11 +162,15 @@
{{/if}}
</td>
<td>
<a
href=
"{{:PluginsAdminUrl('petscms', 'petsadmin', 'saveinfo',array_merge($params, ['id'=>$v['id']]))}}"
class=
"am-btn am-btn-
second
ary am-btn-xs am-radius am-icon-edit am-btn-block"
>
编辑
</a>
<a
href=
"{{:PluginsAdminUrl('petscms', 'petsadmin', 'saveinfo',array_merge($params, ['id'=>$v['id']]))}}"
class=
"am-btn am-btn-
prim
ary am-btn-xs am-radius am-icon-edit am-btn-block"
>
编辑
</a>
{{if $v['status'] neq 3}}
<a
href=
"{{:PluginsHomeUrl('petscms', 'pets', 'detail',array_merge($params, ['id'=>$v['id']]))}}"
class=
"am-btn am-btn-success am-btn-xs am-radius am-icon-newspaper-o am-btn-block"
target=
"_blank"
>
详情
</a>
{{/if}}
<a
href=
"{{:PluginsAdminUrl('petscms', 'petsadmin', 'help',array_merge($params, ['pets_id'=>$v['id']]))}}"
class=
"am-btn am-btn-default am-btn-xs am-radius am-icon-gg am-btn-block"
target=
"_blank"
>
帮助
</a>
<a
href=
"{{:PluginsAdminUrl('petscms', 'petsadmin', 'help',array_merge($params, ['pets_id'=>$v['id']]))}}"
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-icon-gg am-btn-block"
>
帮助
</a>
{{if $v['user_id'] gt 0}}
<button
class=
"am-btn am-btn-warning am-btn-xs am-radius am-icon-circle-o am-btn-block submit-ajax"
data-url=
"{{:PluginsHomeUrl('petscms', 'petsadmin', 'untying')}}"
data-id=
"{{$v.id}}"
data-view=
"reload"
data-msg=
"解绑后不可恢复,确定操作吗?"
>
解绑
</button>
{{/if}}
<button
class=
"am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o am-btn-block submit-delete"
data-url=
"{{:PluginsHomeUrl('petscms', 'petsadmin', 'delete')}}"
data-id=
"{{$v.id}}"
>
删除
</button>
</td>
</tr>
{{/foreach}}
...
...
application/plugins/view/petscms/petsadmin/saveinfo.html
浏览文件 @
e2038f62
...
...
@@ -151,8 +151,8 @@
<button
class=
"am-btn am-btn-default am-radius"
type=
"button"
id=
"map-location-submit"
><span
class=
"am-icon-map-marker"
></span>
定位
</button>
</span>
</div>
<div
id=
"map"
data-level=
"17"
></div>
</div>
<div
id=
"map"
data-level=
"17"
class=
"am-form-group"
></div>
</div>
<div
class=
"am-form-group"
>
...
...
public/static/common/css/common.css
浏览文件 @
e2038f62
...
...
@@ -77,6 +77,9 @@ iframe { width: 100%; height: 100%; border: 0; }
*/
@media
only
screen
and
(
min-width
:
641px
)
{
/* 表单 */
form
.am-form
{
overflow
:
hidden
;
}
form
.am-form
.am-form-group
:hover
,
.plug-file-upload-view
:hover
{
background
:
#f6f9fc
;
}
...
...
public/static/plugins/css/petscms/pets.css
浏览文件 @
e2038f62
...
...
@@ -38,6 +38,9 @@
.chosen-container-single
.chosen-search
input
[
type
=
"text"
]
{
width
:
100%
!important
;
}
.so-list
select
{
width
:
calc
(
100%
-
44px
);
display
:
-webkit-inline-box
;
}
}
.th-operation
{
width
:
120px
;
}
/**
* 添加/编辑页面
...
...
@@ -49,15 +52,9 @@ form.form-validation .am-divider { margin: 10px auto; }
form
.form-validation
.am-alert-secondary
{
background-color
:
#f8f8f8
;
}
form
.form-validation
.am-alert-warning
{
background-color
:
#fffbf7
;
}
/**
* 地图、联动地址
*/
form
.form-validation
.map-address
{
border-bottom
:
0
;
padding-bottom
:
0
;
margin-bottom
:
10px
;
}
form
.form-validation
.region-linkage
.chosen-select
{
display
:
-webkit-inline-box
;
width
:
calc
(
33.3%
-
3px
)
!important
;
...
...
@@ -68,6 +65,7 @@ form.form-validation .region-linkage .chosen-select .chosen-single {
form
.form-validation
#map
{
width
:
100%
;
height
:
350px
;
margin-top
:
5px
;
}
/**
...
...
public/static/plugins/css/petscms/petsadmin.css
浏览文件 @
e2038f62
...
...
@@ -38,6 +38,9 @@
.chosen-container-single
.chosen-search
input
[
type
=
"text"
]
{
width
:
100%
!important
;
}
.so-list
select
{
width
:
calc
(
100%
-
44px
);
display
:
-webkit-inline-box
;
}
}
.th-operation
{
width
:
120px
;
}
/**
* 添加/编辑页面
...
...
@@ -53,11 +56,6 @@ form.form-validation .am-alert-warning { background-color: #fffbf7; }
/**
* 地图、联动地址
*/
form
.form-validation
.map-address
{
border-bottom
:
0
;
padding-bottom
:
0
;
margin-bottom
:
10px
;
}
form
.form-validation
.region-linkage
.chosen-select
{
display
:
-webkit-inline-box
;
width
:
calc
(
33.3%
-
3px
)
!important
;
...
...
@@ -68,6 +66,7 @@ form.form-validation .region-linkage .chosen-select .chosen-single {
form
.form-validation
#map
{
width
:
100%
;
height
:
350px
;
margin-top
:
5px
;
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录