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
86600816
authored
Mar 30, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
e978e746
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
8 deletions
app/Model/CommonModel.php
app/Model/InquiryItemsModel.php
app/Model/InquiryModel.php
app/Model/CommonModel.php
View file @
86600816
...
...
@@ -196,4 +196,5 @@ class CommonModel extends Model
}
\ No newline at end of file
app/Model/InquiryItemsModel.php
View file @
86600816
...
...
@@ -163,8 +163,15 @@ class InquiryItemsModel extends Model
if
(
$res
){
//存在 领取人才要写入吹询价表
$Redis
=
\RedisDB
::
connection
();
$res
=
$res
->
toArray
();
$item
=
$this
->
where
(
"id"
,
$inquiry_items_id
)
->
first
()
->
toArray
();
$main
=
(
new
InquiryModel
())
->
where
(
"id"
,
$item
[
"inquiry_id"
])
->
first
()
->
toArray
();
$CommonModel
=
new
CommonModel
();
foreach
(
$res
as
$k
=>
$v
){
$Redis
->
sadd
(
"frq_inquiry_items_urge"
,
$inquiry_items_id
.
"-"
.
$v
[
"assign_uid"
]);
#发送信息
$CommonModel
->
send_msg
(
$v
[
"assign_uid"
],
$input
[
"user_name"
]
.
'已催报价,询价单号:'
.
$main
[
"inquiry_sn"
]
.
',型号:'
.
$item
[
"goods_name"
]);
}
$indata
=
[
"inquiry_items_id"
=>
$inquiry_items_id
,
"remark"
=>
$input
[
"remark"
],
"create_uid"
=>
$input
[
"user_id"
],
"create_name"
=>
$input
[
"user_name"
],
"create_time"
=>
time
(),
"update_time"
=>
time
()];
...
...
@@ -172,6 +179,8 @@ class InquiryItemsModel extends Model
}
#更新自动报价标志
(
new
InquiryItemsModel
())
->
where
(
"id"
,
$inquiry_items_id
)
->
update
([
"flag"
=>
0
]);
return
[
0
,
"催价成功"
];
}
...
...
@@ -331,10 +340,20 @@ class InquiryItemsModel extends Model
$con
->
commit
();
#发送消息
$info
=
$this
->
where
(
"id"
,
$inquiry_items_id
)
->
value
(
"inquiry_id"
);
$mainStatus
=
(
new
InquiryModel
())
->
where
(
"id"
,
$inquiry_items_id
)
->
value
(
"status"
);
#主单状态
if
(
$mainStatus
==
0
){
#
$itemArr
=
$this
->
where
(
"id"
,
$inquiry_items_id
)
->
first
()
->
toArray
();
#明细
$mainArr
=
(
new
InquiryModel
())
->
where
(
"id"
,
$itemArr
[
"inquiry_id"
])
->
first
()
->
toArray
();
#主单状态
if
(
$mainArr
[
"status"
]
==
1
){
# 启动
#发送修改询价信息
$CommonModel
=
new
CommonModel
();
$assignInfo
=
(
new
InquiryItemsAssignModel
())
->
select
(
"assign_uid"
)
->
where
(
"inquiry_items_id"
,
$inquiry_items_id
)
->
get
();
if
(
$assignInfo
){
$assignInfoArr
=
$assignInfo
->
toArray
();
$currency
=
$itemArr
[
"currency"
]
==
1
?
"¥"
:
"$"
;
$msg
=
$b
[
"user_name"
]
.
'已修改询价,询价单号:'
.
$mainArr
[
"inquiry_sn"
]
.
',型号:'
.
$updateArr
[
"goods_name"
]
.
' 修改内容:价格:'
.
$currency
.
$itemArr
[
"target_price"
]
.
',目标价:'
.
$currency
.
$updateArr
[
"target_price"
];
foreach
(
$assignInfoArr
as
$k
=>
$v
){
$CommonModel
->
send_msg
(
$v
[
"assign_uid"
],
$msg
);
}
}
}
...
...
@@ -528,7 +547,7 @@ class InquiryItemsModel extends Model
$b2
[
"purArr"
]
=
$userInfo
;
break
;
case
"delivery_time"
:
#交期
if
(
strpos
(
$val
,
"天"
)
===
false
||
strpos
(
$val
,
"周"
)
===
false
){
if
(
strpos
(
$val
,
"天"
)
===
false
&&
strpos
(
$val
,
"周"
)
===
false
){
$err
[]
=
$str_msg
.
"交期输入名称有误"
;
}
$delivery_time
=
str_replace
(
"天"
,
""
,
$val
);
...
...
app/Model/InquiryModel.php
View file @
86600816
...
...
@@ -185,11 +185,33 @@ class InquiryModel extends Model
*/
public
function
inquiryClose
(
$input
)
{
if
(
empty
(
@
$input
[
"inquiry_id"
]))
{
$inquiry_id
=
@
$input
[
"inquiry_id"
];
if
(
empty
(
@
$inquiry_id
))
{
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
()]);
$this
->
where
(
"id"
,
$inquiry_id
)
->
update
([
"status"
=>
-
1
,
"remark"
=>
@
$input
[
"remark"
]
?
$input
[
"remark"
]
:
""
,
"update_time"
=>
time
()]);
(
new
InquiryItemsModel
())
->
where
(
"inquiry_id"
,
$inquiry_id
)
->
update
([
"status"
=>
-
1
,
"update_time"
=>
time
()]);
#发送消息
$con
=
DB
::
connection
(
'rfq'
);
$sql
=
'SELECT DISTINCT c.assign_uid,a.inquiry_sn
FROM
lie_inquiry a,
lie_inquiry_items b,
lie_inquiry_items_assign c
WHERE
a.id = b.inquiry_id
AND b.id = c.inquiry_items_id
AND a.`status` <>0
AND a.id ='
.
$inquiry_id
;
$assignInfoArr
=
$con
->
select
(
$sql
);
$CommonModel
=
new
CommonModel
();
foreach
(
$assignInfoArr
as
$k
=>
$v
){
$CommonModel
->
send_msg
(
$v
[
"assign_uid"
],
$input
[
"user_name"
]
.
'已关闭询价,询价单号:'
.
$v
[
"inquiry_sn"
]);
}
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