Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
php_frq_api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2db22a13
authored
Mar 02, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
faf1913d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
13 deletions
app/Http/Controllers/ApiController.php
app/Http/Controllers/ServerController.php
app/Http/function.php
app/Http/routes.php
app/Model/InquiryItemsModel.php
app/Model/InquiryModel.php
app/Http/Controllers/ApiController.php
View file @
2db22a13
...
@@ -37,9 +37,13 @@ class ApiController extends Controller
...
@@ -37,9 +37,13 @@ class ApiController extends Controller
// }
// }
$this
->
$id
(
$request
,
$id
);
$this
->
$id
(
$request
,
$id
);
}
}
//关闭
询价
//关闭
整个询价单
private
function
ApiInquiryClose
(
$request
,
$id
){
private
function
ApiInquiryClose
(
$request
,
$id
){
$this
->
Export
((
new
InquiryModel
())
->
closeInquiry
(
$request
->
input
(
'inquiry_id'
)));
Export
((
new
InquiryModel
())
->
inquiryClose
(
$request
->
input
(
'inquiry_id'
)));
}
//关闭单条询价明细
public
function
ApiInquiryItemsClose
(
$request
,
$id
){
Export
((
new
InquiryItemsModel
())
->
inquiryItemsClose
(
$request
->
input
(
'inquiry_items_id'
)));
}
}
//询价列表
//询价列表
private
function
ApiInquiryList
(
$request
,
$id
){
private
function
ApiInquiryList
(
$request
,
$id
){
...
...
app/Http/Controllers/ServerController.php
View file @
2db22a13
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\Model\InquiryItemsModel
;
use
App\Model\InquiryModel
;
use
App\Model\InquiryModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\Http\Requests
;
use
App\Http\Requests
;
...
@@ -18,6 +19,7 @@ class ServerController extends Controller
...
@@ -18,6 +19,7 @@ class ServerController extends Controller
set_time_limit
(
0
);
set_time_limit
(
0
);
$this
->
$id
(
$request
,
$id
);
$this
->
$id
(
$request
,
$id
);
}
}
/*
/*
* 询报价导出
* 询报价导出
*/
*/
...
...
app/Http/function.php
View file @
2db22a13
...
@@ -1107,9 +1107,9 @@ function createSlat($length = 32)
...
@@ -1107,9 +1107,9 @@ function createSlat($length = 32)
}
}
function
Export
(
$errcode
=
0
,
$errmsg
=
'成功'
,
$data
=
''
){
function
Export
(
$errcode
=
0
,
$errmsg
=
'成功'
,
$data
=
''
){
if
(
is_array
(
$errcode
)){
if
(
is_array
(
$errcode
)){
echo
json_encode
([
'
errcode'
=>
$errcode
[
0
],
'err
msg'
=>
$errcode
[
1
],
'data'
=>!
empty
(
@
$errcode
[
2
])
?@
$errcode
[
2
]
:
''
],
JSON_UNESCAPED_UNICODE
|
JSON_UNESCAPED_SLASHES
);
echo
json_encode
([
'
code'
=>
$errcode
[
0
],
'
msg'
=>
$errcode
[
1
],
'data'
=>!
empty
(
@
$errcode
[
2
])
?@
$errcode
[
2
]
:
''
],
JSON_UNESCAPED_UNICODE
|
JSON_UNESCAPED_SLASHES
);
}
else
{
}
else
{
echo
json_encode
([
'
errcode'
=>
$errcode
,
'err
msg'
=>
$errmsg
,
'data'
=>
$data
],
JSON_UNESCAPED_UNICODE
|
JSON_UNESCAPED_SLASHES
);
echo
json_encode
([
'
code'
=>
$errcode
,
'
msg'
=>
$errmsg
,
'data'
=>
$data
],
JSON_UNESCAPED_UNICODE
|
JSON_UNESCAPED_SLASHES
);
}
}
exit
();
exit
();
}
}
...
...
app/Http/routes.php
View file @
2db22a13
<?php
<?php
Route
::
match
([
'get'
,
'post'
],
'/api/{key}'
,
'ApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/hd/{key}'
,
'HdController@Entrance'
);
Route
::
group
([
'middleware'
=>
'web'
],
function
()
{
Route
::
group
([
'middleware'
=>
'web'
],
function
()
{
Route
::
get
(
'/'
,
'WebController@info'
);
Route
::
get
(
'/'
,
'WebController@info'
);
Route
::
match
([
'get'
,
'post'
],
'/web/{key}'
,
'WebController@info'
);
Route
::
match
([
'get'
,
'post'
],
'/web/{key}'
,
'WebController@info'
);
Route
::
match
([
'get'
,
'post'
],
'/api/{key}'
,
'ApiController@Entrance'
);
// Route::match(['get', 'post'],'/api/{key}', 'ApiController@Entrance');
Route
::
match
([
'get'
,
'post'
],
'/hd/{key}'
,
'HdController@Entrance'
);
// Route::match(['get', 'post'],'/hd/{key}', 'HdController@Entrance');
});
Route
::
group
([
'middleware'
=>
'webapi'
],
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/WebApi/{key}'
,
'WebApiController@Entrance'
);
});
Route
::
group
([
'middleware'
=>
'WmsApi'
],
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/wmsapi/{key}'
,
'WmsApiController@Entrance'
);
});
});
Route
::
match
([
'get'
,
'post'
],
'/server/{key}'
,
'ServerController@Entrance'
);
//
对外提供导出回调接口
Route
::
match
([
'get'
,
'post'
],
'/server/{key}'
,
'ServerController@Entrance'
);
//
对外提供导出回调接口
\ No newline at end of file
app/Model/InquiryItemsModel.php
View file @
2db22a13
...
@@ -134,5 +134,16 @@ class InquiryItemsModel extends Model
...
@@ -134,5 +134,16 @@ class InquiryItemsModel extends Model
}
}
}
}
/*
* 关闭询价
*/
public
function
inquiryItemsClose
(
$inquiry_items_id
){
if
(
!
intval
(
$inquiry_items_id
)){
return
[
1001
,
"询价明细id不得为空!"
];
}
$this
->
where
(
"id"
,
$inquiry_items_id
)
->
update
([
"status"
=>-
1
,
"update_time"
=>
time
()]);
return
[
0
,
"更新成功"
];
}
}
}
\ No newline at end of file
app/Model/InquiryModel.php
View file @
2db22a13
...
@@ -133,7 +133,7 @@ class InquiryModel extends Model
...
@@ -133,7 +133,7 @@ class InquiryModel extends Model
/*
/*
* 关闭询价
* 关闭询价
*/
*/
public
function
closeInquiry
(
$inquiry_id
){
public
function
inquiryClose
(
$inquiry_id
){
$this
->
where
(
"id"
,
$inquiry_id
)
->
update
([
"status"
=>-
1
,
"update_time"
=>
time
()]);
$this
->
where
(
"id"
,
$inquiry_id
)
->
update
([
"status"
=>-
1
,
"update_time"
=>
time
()]);
return
[
0
,
"更新成功"
];
return
[
0
,
"更新成功"
];
}
}
...
...
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