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
fdc05aec
authored
Mar 30, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
83f3d94f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
app/Http/Controllers/ApiController.php
app/Model/QuoteModel.php
app/Http/Controllers/ApiController.php
View file @
fdc05aec
...
@@ -164,6 +164,12 @@ class ApiController extends Controller
...
@@ -164,6 +164,12 @@ class ApiController extends Controller
ExportLayui
((
new
QuoteModel
())
->
lists
(
$input
));
ExportLayui
((
new
QuoteModel
())
->
lists
(
$input
));
}
}
//历史报价
public
function
ApiQuoteHistoryList
(
$input
,
$id
)
{
ExportLayui
((
new
QuoteModel
())
->
historyList
(
$input
));
}
// 撤销报价
// 撤销报价
public
function
ApiCancelQuote
(
$input
,
$id
)
public
function
ApiCancelQuote
(
$input
,
$id
)
{
{
...
...
app/Model/QuoteModel.php
View file @
fdc05aec
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
App\Model
;
namespace
App\Model
;
use
App\map\InquiryMap
;
use
App\map\OperationLogMap
;
use
App\map\OperationLogMap
;
use
App\map\QuoteMap
;
use
App\map\QuoteMap
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
...
@@ -181,6 +182,51 @@ class QuoteModel extends Model
...
@@ -181,6 +182,51 @@ class QuoteModel extends Model
}
}
}
}
// 获取历史报价
public
function
historyList
(
$input
)
{
$page
=
$input
[
'page'
];
$limit
=
$input
[
'limit'
];
$list
=
$this
->
from
(
'quote as q'
)
->
select
(
"q.*"
)
->
join
(
'inquiry_items as it'
,
'q.inquiry_items_id'
,
'='
,
'it.id'
)
->
where
(
function
(
$query
)
use
(
$input
)
{
foreach
(
$input
as
$k
=>
$b
){
switch
(
$k
){
case
"goods_name"
:
$query
->
where
(
'it.goods_name'
,
'like'
,
$b
.
'%'
);
break
;
case
"brand_name"
:
$query
->
where
(
'it.brand_name'
,
'like'
,
$b
.
'%'
);
break
;
}
}
$query
->
whereIn
(
'q.status'
,
[
1
,
2
,
3
]);
});
$list
=
$list
->
orderBy
(
'id'
,
'desc'
)
->
paginate
(
$limit
,
[
'*'
],
'page'
,
$page
)
->
toArray
();
foreach
(
$list
[
'data'
]
as
$b
=>&
$v
)
{
if
(
$v
[
'currency'
]
==
1
){
$v
[
"price_origin"
]
=
"--"
;
}
else
{
$v
[
"price_rmb"
]
=
"--"
;
}
$v
[
"currency"
]
=
InquiryMap
::
$currency
[
$v
[
"currency"
]];
if
(
$v
[
'delivery_time'
]
>
6
)
{
$v
[
'delivery_time'
]
=
intval
(
$v
[
'delivery_time'
]
/
7
)
.
'周'
;
}
else
{
$v
[
'delivery_time'
]
=
$v
[
'delivery_time'
]
.
'天'
;
}
$v
[
"effect_days"
]
=
$v
[
"effect_days"
]
.
"天"
;
$v
[
'price_rmb'
]
=
$v
[
'currency'
]
==
1
?
$v
[
'price_rmb'
]
:
''
;
$v
[
"digikey"
]
=
"包装:"
.
$v
[
"raw_goods_packing"
];
}
return
[
0
,
'获取成功'
,
$list
[
'data'
],
$list
[
'total'
]];
}
// 处理数据
// 处理数据
public
function
handleData
(
$data
,
$type
)
public
function
handleData
(
$data
,
$type
)
{
{
...
@@ -202,6 +248,8 @@ class QuoteModel extends Model
...
@@ -202,6 +248,8 @@ class QuoteModel extends Model
$v
[
'price_rmb'
]
=
$v
[
'currency'
]
==
1
?
$v
[
'price_rmb'
]
:
''
;
$v
[
'price_rmb'
]
=
$v
[
'currency'
]
==
1
?
$v
[
'price_rmb'
]
:
''
;
}
}
$v
[
"digikey"
]
=
"包装"
.
$v
[
"raw_goods_packing"
];
}
}
return
$data
;
return
$data
;
...
...
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