Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopBack
Project
Project
Details
Activity
Releases
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
newshop
newShopBack
Commits
73c27a76
Commit
73c27a76
authored
Nov 25, 2019
by
张晓林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
证照图片上传
parent
e111d745
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
urlmanager.php
backend/config/urlmanager.php
+1
-0
BranchLicenceController.php
backend/controllers/v1/branch/BranchLicenceController.php
+48
-0
No files found.
backend/config/urlmanager.php
View file @
73c27a76
...
@@ -161,6 +161,7 @@ return [
...
@@ -161,6 +161,7 @@ return [
'GET,OPTIONS licence-list'
=>
'licence-list'
,
'GET,OPTIONS licence-list'
=>
'licence-list'
,
'GET,OPTIONS licence-detail'
=>
'licence-detail'
,
'GET,OPTIONS licence-detail'
=>
'licence-detail'
,
'POST,OPTIONS licence-insert'
=>
'licence-insert'
,
'POST,OPTIONS licence-insert'
=>
'licence-insert'
,
'POST,OPTIONS licence-img-upload'
=>
'licence-img-upload'
,
],
],
],
],
//省市区
//省市区
...
...
backend/controllers/v1/branch/BranchLicenceController.php
View file @
73c27a76
...
@@ -6,6 +6,9 @@ use yii\data\ArrayDataProvider;
...
@@ -6,6 +6,9 @@ use yii\data\ArrayDataProvider;
use
backend\models\v1\branch\BranchLicence
;
use
backend\models\v1\branch\BranchLicence
;
use
backend\controllers\v1\BaseController
;
use
backend\controllers\v1\BaseController
;
use
backend\helpers\Func
;
use
backend\helpers\Func
;
use
backend\helpers\UploadFiles
;
use
yii\web\UploadedFile
;
use
yii\web\HttpException
;
class
BranchLicenceController
extends
BaseController
{
class
BranchLicenceController
extends
BaseController
{
...
@@ -29,6 +32,7 @@ class BranchLicenceController extends BaseController{
...
@@ -29,6 +32,7 @@ class BranchLicenceController extends BaseController{
* @OA\Property(property="IS_FROM",description="来源",type="string"),
* @OA\Property(property="IS_FROM",description="来源",type="string"),
* @OA\Property(property="LICENCE_EXPIRY_DATE",description="到期时间",type="string"),
* @OA\Property(property="LICENCE_EXPIRY_DATE",description="到期时间",type="string"),
* @OA\Property(property="IS_SHOW",description="是否显示在前台",type="string"),
* @OA\Property(property="IS_SHOW",description="是否显示在前台",type="string"),
* @OA\Property(property="LICENCE_IMG_URL",description="证照图片",type="string"),
* @OA\Property(property="LICENCE_CONTENT",description="证照说明",type="string"),
* @OA\Property(property="LICENCE_CONTENT",description="证照说明",type="string"),
* )
* )
* )
* )
...
@@ -55,6 +59,50 @@ class BranchLicenceController extends BaseController{
...
@@ -55,6 +59,50 @@ class BranchLicenceController extends BaseController{
}
}
}
}
/**
* @OA\Post(
* path="/backend/web/v1/branch/branch-licences/licence-img-upload",
* tags={"门店&DC"},
* summary="证照图片上传(张晓林)",
* operationId="uploadFile",
* @OA\Response(
* response=200,
* description="上传成功",
* ),
* security={{"Authorization":{}}},
* @OA\RequestBody(
* description="上传文件事例",
* @OA\MediaType(
* mediaType="multipart/form-data",
* @OA\Schema(
* type="object",
* @OA\Property(
* property="uploadFile",
* type="string",
* format="binary"
* ),
* )
* )
* )
* )
*/
public
function
actionLicenceImgUpload
(){
//多文件时依赖注入参数参考UploadFiles类
$model
=
new
UploadFiles
([
'png'
,
'jpg'
,
'jpeg'
]);
if
(
Yii
::
$app
->
request
->
isPost
)
{
//多文件用getInstances
$model
->
uploadFiles
=
UploadedFile
::
getInstance
(
$model
,
'uploadFile'
);
$fileInfo
=
$model
->
upload
();
if
(
$fileInfo
[
'CODE'
]
==
200
)
{
// 文件上传成功
throw
new
HttpException
(
200
);
}
else
{
throw
new
HttpException
(
422
);
}
}
}
/**
/**
* @OA\GET(
* @OA\GET(
* path="/backend/web/v1/branch/branch-licences/licence-list",
* path="/backend/web/v1/branch/branch-licences/licence-list",
...
...
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