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
4edddaec
authored
Mar 09, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
e6cc821d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
app/Http/Controllers/ApiController.php
app/Model/InquiryModel.php
app/Http/Controllers/ApiController.php
View file @
4edddaec
...
...
@@ -114,8 +114,8 @@ class ApiController extends Controller
}
//添加询价
private
function
Api
Add
Inquiry
(
$input
,
$id
){
Export
((
new
InquiryModel
())
->
add
Inquiry
(
$input
));
private
function
Api
Edit
Inquiry
(
$input
,
$id
){
Export
((
new
InquiryModel
())
->
edit
Inquiry
(
$input
));
}
//生成报价/销售 询价单
private
function
ApiAddInquiryReport
(
$input
,
$id
){
...
...
app/Model/InquiryModel.php
View file @
4edddaec
...
...
@@ -49,7 +49,7 @@ class InquiryModel extends Model
case
"goods_name"
:
case
"brand_name"
:
case
"customer_name"
:
$query
->
whereRaw
(
'
lie_b.'
.
$k
.
' like "'
.
$v
.
'%"
'
);
$query
->
whereRaw
(
'
(lie_b.com_name like "'
.
$v
.
'%" or lie_b.user_name like "'
.
$v
.
'%" )
'
);
break
;
case
"status"
:
$query
->
where
(
'b.status'
,
'='
,
$v
);
...
...
@@ -146,6 +146,7 @@ class InquiryModel extends Model
return
[
1001
,
"询价单ID不得为空"
];
}
$this
->
where
(
"id"
,
$input
[
"inquiry_id"
])
->
update
([
"status"
=>-
1
,
"remark"
=>@
$input
[
"remark"
]
?
$input
[
"remark"
]
:
""
,
"update_time"
=>
time
()]);
(
new
InquiryItemsModel
())
->
where
(
"inquiry_id"
,
$input
[
"inquiry_id"
])
->
update
([
"status"
=>-
1
,
"update_time"
=>
time
()]);
return
[
0
,
"关闭整个询价单成功"
];
}
...
...
@@ -317,7 +318,7 @@ class InquiryModel extends Model
}
//从草稿生成正式询价单
public
function
add
Inquiry
(
$input
){
public
function
edit
Inquiry
(
$input
){
if
(
empty
(
$input
[
"inquiry_id"
]))
return
[
1001
,
"缺少询价单号"
];
if
(
empty
(
$input
[
"user"
]))
return
[
1002
,
"请选择客户"
];
if
(
empty
(
$input
[
"delivery_place"
]))
return
[
1002
,
"请选择交货地"
];
...
...
@@ -338,9 +339,8 @@ class InquiryModel extends Model
$data
[
"com_name"
]
=
$user
[
0
][
"name"
];
}
$check
=
$inqueryId
=
$this
->
where
(
"id"
,
$input
[
"inquiry_id"
])
->
update
(
$data
);
return
[
0
,
"
新增询价
成功"
];
return
[
0
,
"
操作
成功"
];
}
}
\ No newline at end of file
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