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
6b55b4f1
Commit
6b55b4f1
authored
Aug 31, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c端图库-上传图片接口
parent
e96dcacf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
137 additions
and
1 deletion
+137
-1
ImageDepot.php
application/api/controller/ImageDepot.php
+63
-0
Basic.php
application/api/extend/Basic.php
+1
-1
ImageDepot.php
application/api/validate/ImageDepot.php
+29
-0
Member.php
application/index/controller/Member.php
+6
-0
GImageDepot.php
application/model/GImageDepot.php
+34
-0
route.php
application/route.php
+4
-0
No files found.
application/api/controller/ImageDepot.php
0 → 100755
View file @
6b55b4f1
<?php
namespace
app\api\controller
;
use
app\api\extend\Basic
;
use
app\api_broker\service\VerifyRepetitionService
;
use
app\model\AAgents
;
use
app\model\Evaluate
;
use
app\model\EvaluateSign
;
use
app\model\GImageDepot
;
use
app\model\OBargainModel
;
/**
* zhuwei
* Class ImageDepot
* @package app\api\controller
* 2018-08-31 10:35:07
*/
class
ImageDepot
extends
Basic
{
protected
$imageDepot
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
imageDepot
=
new
GImageDepot
();
}
/**
* 上传保存图片
* @return \think\Response
*/
public
function
addImageDepot
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"img_type" => 2,
"label_type" => 3,
"img_name" => 'cehsi'
);*/
$checkResult
=
$this
->
validate
(
$params
,
"ImageDepot.addImageDepot"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$params_
[
"img_type"
]
=
$params
[
'img_type'
];
$params_
[
"label_type"
]
=
$params
[
'label_type'
];
$params_
[
"img_name"
]
=
$params
[
'img_name'
];
$res
=
$this
->
imageDepot
->
saveData
(
$params_
);
//int(1)
if
(
$res
)
{
return
$this
->
response
(
"200"
,
"成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
}
application/api/extend/Basic.php
View file @
6b55b4f1
...
@@ -108,7 +108,7 @@ class Basic extends Controller
...
@@ -108,7 +108,7 @@ class Basic extends Controller
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
//过滤掉不需要验证token的接口
//过滤掉不需要验证token的接口
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
$this
->
tokenVerify
();
//
$this->tokenVerify();
}
}
}
}
...
...
application/api/validate/ImageDepot.php
0 → 100755
View file @
6b55b4f1
<?php
namespace
app\api\validate
;
use
think\Validate
;
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'
],
];
}
\ No newline at end of file
application/index/controller/Member.php
View file @
6b55b4f1
...
@@ -219,6 +219,12 @@ class Member extends Basic{
...
@@ -219,6 +219,12 @@ class Member extends Basic{
$type
=
3
;
$type
=
3
;
}
}
//客方姓名
if
(
!
empty
(
$params
[
'user_agent'
]))
{
$where
[
'b.phone'
]
=
$params
[
'user_agent'
];
$type
=
3
;
}
//客方ID
//客方ID
if
(
!
empty
(
$params
[
'agent_id'
]))
{
if
(
!
empty
(
$params
[
'agent_id'
]))
{
...
...
application/model/GImageDepot.php
0 → 100755
View file @
6b55b4f1
<?php
namespace
app\model
;
use
think\Db
;
use
think\Model
;
class
GImageDepot
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'g_image_depot'
;
/**
`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` '创建时间',
*/
/**
* 添加图片 上传保存图片
* @param $data
* @return int|string
*/
public
function
saveData
(
$data
)
{
$time
=
date
(
"Y-m-d h:i:sa"
,
time
());
$data
[
'create_time'
]
=
$time
;
$data
[
'update_time'
]
=
$time
;
return
$this
->
insert
(
$data
);
}
}
application/route.php
View file @
6b55b4f1
...
@@ -379,6 +379,10 @@ Route::group('api', [
...
@@ -379,6 +379,10 @@ Route::group('api', [
'saveSiteCity'
=>
[
'api/Location/saveSiteCity'
,
[
'method'
=>
'POST|GET'
]
],
//保存默认城市选择 c端
'saveSiteCity'
=>
[
'api/Location/saveSiteCity'
,
[
'method'
=>
'POST|GET'
]
],
//保存默认城市选择 c端
'addImageDepot'
=>
[
'api/ImageDepot/addImageDepot'
,
[
'method'
=>
'get | post'
]
],
]);
]);
Route
::
group
(
'chat'
,
[
Route
::
group
(
'chat'
,
[
...
...
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