Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
6275f048
Commit
6275f048
authored
Aug 31, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
70aef059
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
4 deletions
+75
-4
ImageDepot.php
application/api/controller/ImageDepot.php
+44
-1
ImageDepot.php
application/api/validate/ImageDepot.php
+2
-3
GImageDepot.php
application/model/GImageDepot.php
+29
-0
No files found.
application/api/controller/ImageDepot.php
View file @
6275f048
...
...
@@ -67,7 +67,7 @@ class ImageDepot extends Basic
return
$this
->
response
(
"101"
,
$checkResult
);
}
$params_
[
"img_type"
]
=
$params
[
'img_type'
];
$params_
[
"label
_type"
]
=
$params
[
'label_type
'
];
$params_
[
"label
"
]
=
$params
[
'label
'
];
$params_
[
"img_name"
]
=
$params
[
'img_name'
];
$res
=
$this
->
imageDepot
->
saveData
(
$params_
);
//int(1)
...
...
@@ -80,5 +80,48 @@ class ImageDepot extends Basic
}
/**
* 获取图片列表
* @return \think\Response
*/
public
function
getImageDepotList
()
{
$params
=
$this
->
params
;
/*$params = array(
"agents_id" => 5740
);*/
/**
`id`
`img_type` '图片类型:0室外图 ,1室内图 ,2人群图',
`label_type` '业态标签:0商场美食、1沿街餐饮、2百货零售、3服饰鞋包、4休闲娱乐、5亲子教育、6百货超市、7办公',
`img_name` '图片名称',
`img_status` '删除状态 0正常 1删除',
`update_time` '更新时间',
`create_time` '创建时间',
*/
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$field
=
'id,img_type,label,img_name,img_status,create_time'
;
$params_
[
'img_status'
]
=
0
;
$res
=
$this
->
imageDepot
->
getImageDepotList
(
$field
,
$params_
,
$pageNo
,
$pageSize
);
$res_total
=
$this
->
imageDepot
->
getImageDepotListTotal
(
$params_
);
foreach
(
$res
as
$k
=>
$v
)
{
$res
[
$k
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$v
[
"user_phone"
]);
}
$data
[
'total'
]
=
$res_total
;
$data
[
'user_date'
]
=
$res
;
return
$this
->
response
(
"200"
,
"成功"
,
$data
);
}
}
application/api/validate/ImageDepot.php
View file @
6275f048
...
...
@@ -11,18 +11,16 @@ class ImageDepot extends Validate {
protected
$rule
=
[
'img_type'
=>
'require'
,
'label_type'
=>
'require'
,
'img_name'
=>
'require'
];
protected
$message
=
[
'img_type.require'
=>
'图片类型不能为空'
,
'label_type.require'
=>
'图片标签不能为空'
,
'img_name.require'
=>
'图片名不能为空'
,
];
protected
$scene
=
[
'addImageDepot'
=>
[
'img_type'
,
'
label_type'
,
'
img_name'
],
'addImageDepot'
=>
[
'img_type'
,
'img_name'
],
];
}
\ No newline at end of file
application/model/GImageDepot.php
View file @
6275f048
...
...
@@ -31,4 +31,33 @@ class GImageDepot extends Model
$data
[
'update_time'
]
=
$time
;
return
$this
->
insert
(
$data
);
}
/**
* 查询
*/
public
function
getImageDepotList
(
$field
,
$params
,
$pageNo
,
$pageSize
)
{
$order
=
"create_time desc"
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order
)
->
select
();
//dump($this->getLastSql());
return
$result
;
}
/**
* 查询统计数据
*/
public
function
getImageDepotListTotal
(
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
where
(
$params
)
->
count
();
//dump($this->getLastSql());
return
$result
;
}
}
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