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
9afc8c42
Commit
9afc8c42
authored
Aug 15, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
素质测评 方法分析 价值观考核图片
parent
52f14d64
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
7 deletions
+84
-7
Statement.php
application/api_broker/controller/Statement.php
+2
-7
uploadWorkLearning.php
application/api_broker/controller/uploadWorkLearning.php
+60
-0
RWorkLearningModel.php
application/model/RWorkLearningModel.php
+21
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Statement.php
View file @
9afc8c42
...
@@ -107,17 +107,12 @@ class Statement extends Basic
...
@@ -107,17 +107,12 @@ class Statement extends Basic
$data
[
'img_url'
]
=
$img_name
;
$data
[
'img_url'
]
=
$img_name
;
$data
[
'type'
]
=
$this
->
params
[
'type'
];
$data
[
'type'
]
=
$this
->
params
[
'type'
];
$data
[
'img_name'
]
=
IMAGES_URL
.
$url
;
$data
[
'img_name'
]
=
IMAGES_URL
.
$url
;
$
result
=
$
agent_report
->
editData
(
$data
);
$agent_report
->
editData
(
$data
);
}
else
{
}
else
{
$result
=
0
;
}
if
(
!
$result
)
{
$code
=
101
;
$code
=
101
;
$msg
=
'生成图片失败'
;
$msg
=
'生成图片失败'
;
}
}
return
$this
->
response
(
$code
,
$msg
,
$img_name
);
return
$this
->
response
(
$code
,
$msg
,
$data
[
'img_name'
]);
}
}
/**
/**
...
...
application/api_broker/controller/uploadWorkLearning.php
0 → 100644
View file @
9afc8c42
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\model\RWorkLearningModel
;
class
uploadWorkLearning
extends
Basic
{
/**
* 保存0素质测评 1方法分析 2价值观考核图片
*
* @return \think\Response
*/
public
function
workLearningImage
()
{
header
(
'Access-Control-Allow-Origin:*'
);
if
(
empty
(
$this
->
params
[
"agent_id"
])
||
empty
(
$this
->
params
[
"img"
]))
{
return
$this
->
response
(
"101"
,
"参数错误"
);
}
if
(
!
in_array
(
$this
->
params
[
'type'
],
[
0
,
1
,
2
]))
{
return
$this
->
response
(
"101"
,
"类型错误"
);
}
$img_title
=
""
;
$img
=
""
;
//单图
$base64_image_content
=
$this
->
params
[
"img"
];
if
(
preg_match
(
'/^(data:\s*image\/(\w+);base64,)/'
,
$base64_image_content
,
$array
))
{
$img_title
=
$array
[
2
];
//jpeg
$img
=
base64_decode
(
str_replace
(
$array
[
1
],
''
,
$base64_image_content
));
//返回文件流
}
$tmp_file
=
time
();
$img_name
=
md5
(
uniqid
(
$tmp_file
))
.
'.'
.
$img_title
;
//图片名
$url
=
'static/week_work_img/'
.
$img_name
;
$code
=
200
;
$msg
=
''
;
if
(
file_put_contents
(
$url
,
$img
))
{
$agent_report
=
new
RWorkLearningModel
();
$data
[
'agent_id'
]
=
$this
->
params
[
'agent_id'
];
$data
[
'img_url'
]
=
$img_name
;
$data
[
'type'
]
=
$this
->
params
[
'type'
];
//0素质测评 1方法分析 2价值观考核
$data
[
'img_name'
]
=
IMAGES_URL
.
$url
;
$agent_report
->
editData
(
$data
);
}
else
{
$code
=
101
;
$msg
=
'生成图片失败'
;
}
return
$this
->
response
(
$code
,
$msg
,
$img_name
);
}
}
\ No newline at end of file
application/model/RWorkLearningModel.php
0 → 100644
View file @
9afc8c42
<?php
namespace
app\model
;
use
think\Db
;
class
RWorkLearningModel
extends
BaseModel
{
protected
$table
=
'r_work_learning'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
}
\ No newline at end of file
application/route.php
View file @
9afc8c42
...
@@ -1046,6 +1046,7 @@ Route::group('broker', [
...
@@ -1046,6 +1046,7 @@ Route::group('broker', [
'addFeeImage'
=>
[
'api_broker/StoreFee/addFeeImage'
,
[
'method'
=>
'POST'
]],
//新增报销申请图片
'addFeeImage'
=>
[
'api_broker/StoreFee/addFeeImage'
,
[
'method'
=>
'POST'
]],
//新增报销申请图片
'getApplyForFeeStore'
=>
[
'api_broker/StoreFee/getApplyForFeeStore'
,
[
'method'
=>
'GET'
]],
//获取门店地址
'getApplyForFeeStore'
=>
[
'api_broker/StoreFee/getApplyForFeeStore'
,
[
'method'
=>
'GET'
]],
//获取门店地址
'deviceList'
=>
[
'api_broker/Broker/deviceList'
,
[
'method'
=>
'GET'
]],
//设备列表
'deviceList'
=>
[
'api_broker/Broker/deviceList'
,
[
'method'
=>
'GET'
]],
//设备列表
'uploadWorkLearning'
=>
[
'api_broker/workLearningImage/uploadWorkLearning'
,
[
'method'
=>
'GET'
]],
//保存0素质测评 1方法分析 2价值观考核图片
]);
]);
...
...
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