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
0494341d
authored
Mar 30, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
调整交期
parents
49326f8d
e978e746
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
4 deletions
app/Model/InquiryModel.php
app/Model/QuoteModel.php
app/Model/InquiryModel.php
View file @
0494341d
...
...
@@ -140,7 +140,7 @@ class InquiryModel extends Model
}
#交货日期
$v
[
'delivery_time'
]
=
$v
[
'delivery_time'
]
>
6
?
$v
[
'delivery_time'
]
.
'周'
:
$v
[
'delivery_time'
]
.
"天"
;
$v
[
'delivery_time'
]
=
$v
[
'delivery_time'
]
>
6
?
(
$v
[
'delivery_time'
]
/
7
)
.
'周'
:
$v
[
'delivery_time'
]
.
"天"
;
#查询所有报价
$v
[
'quote_price'
]
=
"--"
;
...
...
app/Model/QuoteModel.php
View file @
0494341d
...
...
@@ -175,14 +175,14 @@ class QuoteModel extends Model
}
else
{
$list
=
$list
->
paginate
(
$limit
,
[
'*'
],
'page'
,
$page
)
->
toArray
();
$list
[
'data'
]
=
$this
->
handleData
(
$list
[
'data'
]);
$list
[
'data'
]
=
$this
->
handleData
(
$list
[
'data'
]
,
$type
);
return
[
0
,
'获取成功'
,
$list
[
'data'
],
$list
[
'total'
]];
}
}
// 处理数据
public
function
handleData
(
$data
)
public
function
handleData
(
$data
,
$type
)
{
if
(
empty
(
$data
))
return
$data
;
...
...
@@ -192,6 +192,14 @@ class QuoteModel extends Model
$v
[
'currency_val'
]
=
$v
[
'currency'
]
==
1
?
'RMB'
:
'USD'
;
$v
[
'price'
]
=
$v
[
'currency'
]
==
1
?
$currency_sign
.
$v
[
'price_rmb'
]
:
$currency_sign
.
$v
[
'price_origin'
];
$v
[
'status_val'
]
=
array_get
(
Config
(
'quote.quote_status'
),
$v
[
'status'
],
''
);
if
(
$type
==
3
)
{
// 报价草稿
if
(
$v
[
'delivery_time'
]
>
6
)
{
$v
[
'delivery_time'
]
=
intval
(
$v
[
'delivery_time'
]
/
7
)
.
'周'
;
}
else
{
$v
[
'delivery_time'
]
=
$v
[
'delivery_time'
]
.
'天'
;
}
}
}
return
$data
;
...
...
@@ -330,7 +338,7 @@ class QuoteModel extends Model
$InquiryModel
=
new
InquiryModel
;
$inquiry_uid
=
$InquiryModel
->
where
(
'id'
,
$inquiry_id
)
->
value
(
'create_uid'
);
// 询价人
$contents
=
'
系统自动
报价,请及时查看!'
;
$contents
=
'
您有新
报价,请及时查看!'
;
$CommonModel
->
send_msg
(
$inquiry_uid
,
$contents
);
return
[
0
,
"新增成功"
];
...
...
@@ -476,6 +484,13 @@ class QuoteModel extends Model
$v
[
'price_rmb'
]
=
$rate
?
number_format
(
$v
[
'price_origin'
]
*
$rate
,
6
)
:
0
;
}
if
(
strpos
(
$v
[
'delivery_time'
],
"周"
)
!==
false
)
{
$delivery_time_week
=
intval
(
str_replace
(
"周"
,
""
,
$v
[
'delivery_time'
]));
$v
[
'delivery_time'
]
=
$delivery_time_week
*
7
;
}
else
{
$v
[
'delivery_time'
]
=
intval
(
str_replace
(
"天"
,
""
,
$v
[
'delivery_time'
]));
}
$v
[
'quote_sn'
]
=
$ApiController
->
createSn
(
$this
,
'quote_sn'
,
'B'
);
$v
[
'inquiry_id'
]
=
$input
[
'inquiry_id'
];
$v
[
'inquiry_sn'
]
=
$input
[
'inquiry_sn'
];
...
...
@@ -568,6 +583,23 @@ class QuoteModel extends Model
return
;
}
if
(
strpos
(
$val
[
'delivery_time'
],
"天"
)
===
false
&&
strpos
(
$val
[
'delivery_time'
],
"周"
)
===
false
)
{
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,交期输入有误,请以天或周结尾'
;
return
;
}
$delivery_time_day
=
intval
(
str_replace
(
"天"
,
""
,
$val
[
'delivery_time'
]));
if
(
$delivery_time_day
>
6
)
{
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,交期输入有误,单位为天时,不能大于6,请按周计数'
;
return
;
}
$delivery_time_week
=
intval
(
str_replace
(
"周"
,
""
,
$val
[
'delivery_time'
]));
if
(
$delivery_time_week
>
108
)
{
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,交期输入有误,单位为周时,不能大于108周'
;
return
;
}
foreach
(
$val
as
$k
=>
$v
)
{
if
(
in_array
(
$k
,
$required_keys
))
{
if
(
empty
(
$v
))
{
// 若必填项值为空,返回提示信息
...
...
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