Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
206a8d56
Commit
206a8d56
authored
Nov 19, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动/商家
parent
3e63713b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
324 additions
and
3 deletions
+324
-3
application/admin/controller/Project.php
+18
-0
application/admin/view/project/index.html
+2
-2
application/admin/view/project/save.html
+303
-0
application/database.php
+1
-1
public/upload/qrcode/20181119/4da8f9bbc5596da3b73c54ac0ec38bfa.jpg
+0
-0
public/upload/qrcode/20181119/5abb3bd9ac9f1e2a54a4afe65905a831.jpg
+0
-0
No files found.
application/admin/controller/Project.php
View file @
206a8d56
...
...
@@ -11,7 +11,10 @@ namespace app\admin\controller;
use
app\admin\controller\AuthBase
;
use
app\common\model\Admin
as
AdminModel
;
use
app\admin\controller\Upload
;
use
app\common\model\Catalogs
;
use
app\common\model\Citys
;
use
app\common\model\Project
as
ProjectModel
;
use
app\common\model\Tags
;
class
Project
extends
AuthBase
{
...
...
@@ -548,4 +551,19 @@ class Project extends AuthBase
$project
->
allowField
(
'id'
,
'sort'
)
->
update
(
input
(
'post.'
));
halt
(
$project
->
getLastSql
());
}
public
function
save
()
{
if
(
input
(
'id'
)){
$info
=
ProjectModel
::
get
(
input
(
'id'
));
$this
->
assign
(
'info'
,
$info
);
}
//分类
$catalogs
=
Catalogs
::
all
();
//城市
$city
=
Citys
::
all
();
//标签
$tags
=
Tags
::
all
();
return
$this
->
fetch
(
''
,
compact
(
'catalogs'
,
'city'
,
'tags'
));
}
}
application/admin/view/project/index.html
View file @
206a8d56
...
...
@@ -60,7 +60,7 @@
<button
type=
"submit"
class=
"btn btn-primary"
>
搜索
</button>
</form>
<div
class=
" pull-left margin-left"
>
<a
href=
"{:url('admin/project/
creat
e')}"
class=
"btn btn-success"
>
创建活动/商家
</a>
<a
href=
"{:url('admin/project/
sav
e')}"
class=
"btn btn-success"
>
创建活动/商家
</a>
</div>
</div>
</div>
...
...
@@ -149,7 +149,7 @@
<input
type=
"number"
size=
"4"
style=
"width:50px"
onchange=
"setSort(this.value,{$vo.id})"
value=
"{$vo.sort}"
>
</td>
<td>
<a
href=
"{:url('admin/project/
updateProject
',['id'=>$vo.id,'page'=>input('page')])}"
class=
"btn btn-xs btn-primary"
><i
class=
"fa fa-pencil"
></i></a>
<a
href=
"{:url('admin/project/
save
',['id'=>$vo.id,'page'=>input('page')])}"
class=
"btn btn-xs btn-primary"
><i
class=
"fa fa-pencil"
></i></a>
<a
href=
"javascript:"
oid=
"{$vo.id}"
class=
"btn btn-xs btn-danger btn-delete"
><i
class=
"fa fa-trash"
></i></a>
</td>
</tr>
...
...
application/admin/view/project/save.html
0 → 100644
View file @
206a8d56
{layout name="public/fullscreen"}
<link
rel=
"stylesheet"
href=
"/static/validation/css/validationEngine.jquery.css"
>
<link
rel=
"stylesheet"
href=
"/static/fileinput/css/fileinput.css"
>
<link
rel=
"stylesheet"
href=
"/static/bootstrap-select/css/bootstrap-select.min.css"
>
<link
rel=
"stylesheet"
href=
"/static/datetimepicker/css/bootstrap-datetimepicker.min.css"
>
<script
src=
"/static/layer/layer.js"
></script>
<style
type=
"text/css"
>
.progress-bar
{
text-align
:
center
;
}
.dropdown-menu
{
z-index
:
100000
;
}
</style>
<section
class=
"wrapper"
>
<h3
class=
""
>
<i
class=
"fa fa-angle-right"
></i>
<a
href=
"{:url('admin/project/index')}"
>
活动/商家列表
</a>
<i
class=
"fa fa-angle-right"
></i>
{if isset($info)}修改活动/商家 {else/} 创建活动/商家{/if}
</h3>
<hr>
<form
action=
""
method=
"post"
class=
"form-horizontal"
enctype=
"multipart/form-data"
onsubmit=
"save(this);return false;"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
类型
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<select
name=
"type"
class=
"form-control"
onchange=
"changeType(this.value)"
>
<option
value=
"1"
>
活动
</option>
<option
value=
"2"
>
商家
</option>
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
名称
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
class=
"form-control validate[required]"
name=
"title"
placeholder=
"活动/商家名称"
value=
""
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
分类
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<select
class=
"form-control selectpicker"
name=
'catalog_id'
data-live-search=
"true"
>
{foreach $catalogs as $v}
<option
value=
"{$v['name']}"
>
{$v['name']}
</option>
{/foreach}
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
国内/国外
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<select
name=
"region_type"
class=
"form-control"
>
<option
value=
"1"
>
国内
</option>
<option
value=
"2"
>
国外
</option>
</select>
</div>
</div>
<div
class=
"form-group type_toggle type-activity"
id=
"time_period"
>
<label
class=
"col-sm-2 control-label text-right"
>
活动时间
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
class=
"form-control validate[required]"
name=
"time_period"
id=
"start"
placeholder=
"请填写活动时间"
value=
""
>
</div>
</div>
<div
class=
"form-group type_toggle type-activity"
>
<label
class=
"col-sm-2 control-label text-right"
>
报名截止时间
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
class=
"form-control validate[required,custom[dateTime]]"
name=
"sign_endtime"
id=
"end"
value=
""
placeholder=
"请填写报名截止时间"
>
</div>
</div>
<div
class=
"form-group type_toggle type-activity"
>
<label
class=
"col-sm-2 control-label text-right"
>
组数限制
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
class=
"form-control validate[required,custom[number]]"
name=
"sign_limits"
value=
""
placeholder=
"限制家庭组数"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
城市
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<select
class=
"form-control selectpicker"
name=
'city'
data-live-search=
"true"
>
{foreach city as $v}
<option
value=
"{$v.id}"
>
{$v['name']}
</option>
{/foreach}
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
标签
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<select
class=
"selectpicker form-control"
name=
"tags"
multiple
data-live-search=
"true"
>
{foreach $tags as $v}
<option
value=
"{$v['id']}"
>
{$v['name']}
</option>
{/foreach}
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
地点
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
class=
"form-control validate[required]"
name=
"location"
placeholder=
"地点"
value=
""
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
经纬度
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6 "
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
>
经度
</span>
<input
type=
"number"
class=
"form-control validate[required]"
name=
"longitude"
placeholder=
"经度"
value=
""
>
<span
class=
"input-group-addon"
>
纬度
</span>
<input
type=
"number"
class=
"form-control validate[required]"
name=
"latitude"
placeholder=
"纬度"
value=
""
>
</div>
<span
class=
"form-group-tip"
>
经纬度在地图上搜索并复制粘贴过来即可,
<a
href=
"http://www.gpsspg.com/maps.htm"
target=
"_blank"
>
立即查看地图
</a>
。
</span>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
价格
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
class=
"form-control validate[required,custom[number]]"
name=
"price"
placeholder=
"价格"
value=
""
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
会员价
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
class=
"form-control validate[required,custom[number]]"
name=
"vip_price"
placeholder=
"价格"
value=
""
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
晚数
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
type=
"text"
class=
"form-control validate[required,custom[number]]"
name=
"night_num"
value=
""
placeholder=
"晚数"
>
</div>
</div>
<!-- <input type="hidden" id="poster" name="poster"> -->
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
封面
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
id=
"input-b1"
name=
""
type=
"file"
>
<span
class=
"form-group-tip"
>
* 尺寸建议:260px*190px
</span>
</div>
</div>
<!-- <input type="hidden" name="banners" id="banners"> -->
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label text-right"
>
轮播图
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
id=
"input-b2"
name=
""
multiple
type=
"file"
>
<span
class=
"form-group-tip"
>
* 尺寸建议:260px*190px
</span>
</div>
</div>
<!-- <input type="hidden" name="kf_qrcode" id="kf_qrcode"> -->
<div
class=
"form-group type_toggle_2"
id=
"qrcode"
>
<label
class=
"col-sm-2 control-label text-right"
>
客服二维码
</label>
<div
class=
"col-sm-10 col-md-8 col-lg-6"
>
<input
id=
"input-b3"
name=
"aaaaaaaaaaaaa"
type=
"file"
>
<span
class=
"form-group-tip"
>
* 尺寸建议:100px*100px
</span>
</div>
</div>
<input
type=
"hidden"
id=
"poster"
name=
"poster"
>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-20"
>
<button
class=
"btn btn-success"
id=
"btn-save"
>
保存
</button>
</div>
</div>
</form>
<!-- 文件上传和select插件 -->
<script
type=
"text/javascript"
src=
"/static/fileinput/js/fileinput.js"
></script>
<script
type=
"text/javascript"
src=
"/static/fileinput/js/locales/zh.js"
></script>
<script
type=
"text/javascript"
src=
"/static/bootstrap-select/js/bootstrap-select.min.js"
></script>
<script
type=
"text/javascript"
src=
"/static/bootstrap-select/js/i18n/defaults-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/static/validation/js/jquery.validationEngine-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/static/validation/js/jquery.validationEngine.js"
></script>
<script
type=
"text/javascript"
src=
"/static/datetimepicker/js/bootstrap-datetimepicker.min.js"
></script>
<script
type=
"text/javascript"
src=
"/static/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
></script>
<!-- 编辑器配置文件 -->
<script
src=
"/static/qiniu_ueditor143/ueditor.config.js"
></script>
<script
src=
"/static/qiniu_ueditor143/ueditor.all.min.js"
></script>
<script
src=
"/static/qiniu_ueditor143/lang/zh-cn/zh-cn.js"
></script>
<script>
// 初始化文件上传
initFileInput
(
$
(
"#input-b1"
),
''
);
initFileInput
(
$
(
"#input-b3"
),
''
);
// 单文件上传
function
initFileInput
(
el
,
initArr
,
initConfig
)
{
var
initialPreview
=
[];
if
(
initArr
)
{
initialPreview
.
push
(
initArr
);
}
el
.
fileinput
({
language
:
'zh'
,
initialPreview
:
initialPreview
,
uploadExtraData
:
{
'name'
:
'banner-choose'
},
// initialPreviewConfig: initConfig,
autoReplace
:
true
,
showUpload
:
false
,
//是否显示上 传按钮
initialPreviewShowDelete
:
true
,
initialPreviewAsData
:
true
,
dropZoneEnabled
:
false
,
showRemove
:
false
,
overwriteInitial
:
true
,
showUploadedThumbs
:
false
,
showClose
:
false
,
allowedFileExtensions
:
[
'bmp'
,
'jpg'
,
'png'
,
'tif'
,
'gif'
,
'pcx'
,
'tga'
,
'exif'
,
'fpx'
,
'svg'
,
'cdr'
,
'pcd'
,
'dxf'
,
'ufo'
,
'eps'
,
'raw'
,
'WMF'
,
'webp'
],
//接收的文件后缀
})
}
// 多文件上传
var
fileUpload
=
$
(
"#input-b2"
).
fileinput
({
language
:
'zh'
,
initialPreview
:
bannersInit
,
uploadExtraData
:
{
'name'
:
'banner-choose'
},
initialPreviewConfig
:
bannerConfig
,
initialPreviewShowDelete
:
true
,
initialPreviewAsData
:
true
,
dropZoneEnabled
:
false
,
showRemove
:
false
,
showClose
:
false
,
autoReplace
:
true
,
showUpload
:
false
,
//是否显示上 传按钮
overwriteInitial
:
false
,
showUploadedThumbs
:
false
,
removeLabel
:
'remove'
,
allowedFileExtensions
:
[
'bmp'
,
'jpg'
,
'png'
,
'tif'
,
'gif'
,
'pcx'
,
'tga'
,
'exif'
,
'fpx'
,
'svg'
,
'cdr'
,
'pcd'
,
'dxf'
,
'ufo'
,
'eps'
,
'raw'
,
'WMF'
,
'webp'
],
//接收的文件后缀
}).
on
(
'filepredelete'
,
function
(
event
,
key
,
three
,
four
)
{
if
(
!
confirm
(
'将立即从数据库中删除该图片,且不可撤回,是否继续'
))
{
four
.
abort
();
}
});
// 初始化时间选择器
$
(
"#start"
).
datetimepicker
({
language
:
'zh-CN'
,
autoclose
:
true
,
format
:
'yyyy-mm-dd hh:ii:00'
});
$
(
"#end"
).
datetimepicker
({
language
:
'zh-CN'
,
autoclose
:
true
,
format
:
'yyyy-mm-dd hh:ii:00'
});
//初始化商家的数据
changeType
({
$info
[
'type'
]
??
1
},
true
);
//更换活动/商家
function
changeType
(
type
,
init
)
{
//设置默认值
init
=
arguments
[
1
]
?
arguments
[
1
]
:
false
;
if
(
init
)
{
$
(
'.type-activity'
).
hide
();
$
(
'.type-business'
).
hide
();
}
//隐藏或者显示活动商家
if
(
type
==
1
)
{
$
(
'.type-activity'
).
fadeIn
();
$
(
'.type-business'
).
fadeOut
();
}
else
if
(
type
==
2
)
{
$
(
'.type-activity'
).
fadeOut
();
$
(
'.type-business'
).
fadeIn
();
}
}
//提交表单
function
save
(
obj
)
{
var
poster
=
$
(
'#input-b1'
).
fileinput
(
'getFileStack'
);
console
.
log
(
poster
);
console
.
log
(
$
(
obj
).
serialize
());
}
</script>
</section>
application/database.php
View file @
206a8d56
...
...
@@ -13,7 +13,7 @@ $config = [
// 数据库类型
'type'
=>
'mysql'
,
// 服务器地址
'hostname'
=>
'
127.0.0.1
'
,
'hostname'
=>
'
mkt.jqlink.tech
'
,
// 数据库名
'database'
=>
'maveler'
,
// 用户名
...
...
public/upload/qrcode/20181119/4da8f9bbc5596da3b73c54ac0ec38bfa.jpg
0 → 100644
View file @
206a8d56
27.3 KB
public/upload/qrcode/20181119/5abb3bd9ac9f1e2a54a4afe65905a831.jpg
0 → 100644
View file @
206a8d56
27.3 KB
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