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
75ac0cd7
authored
Mar 29, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
ssh://119.23.72.7:22611/q578953158/php_frq_api
parents
130da05a
66fb147a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
6 deletions
app/Model/QuoteModel.php
app/Model/QuoteModel.php
View file @
75ac0cd7
...
@@ -233,6 +233,13 @@ class QuoteModel extends Model
...
@@ -233,6 +233,13 @@ class QuoteModel extends Model
$data
[
'create_name'
]
=
$input
[
'user_name'
];
$data
[
'create_name'
]
=
$input
[
'user_name'
];
OpLogModel
::
log
(
$data
);
OpLogModel
::
log
(
$data
);
// 推送消息
$InquiryModel
=
new
InquiryModel
;
$inquiry_uid
=
$InquiryModel
->
where
(
'id'
,
$quote_info
[
'inquiry_id'
])
->
value
(
'create_uid'
);
// 询价人
$contents
=
$input
[
'user_name'
]
.
'已撤销报价,请及时查看!报价单号:'
.
$quote_info
[
'quote_sn'
]
.
',型号:'
.
$quote_info
[
'goods_name'
];
$CommonModel
->
send_msg
(
$inquiry_uid
,
$contents
);
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
return
[
1
,
$e
->
getMessage
()];
return
[
1
,
$e
->
getMessage
()];
}
}
...
@@ -276,11 +283,11 @@ class QuoteModel extends Model
...
@@ -276,11 +283,11 @@ class QuoteModel extends Model
$v
[
"class_id2"
]
=
$classInfo
[
"class_id2"
];
$v
[
"class_id2"
]
=
$classInfo
[
"class_id2"
];
$v
[
"class_id2_name"
]
=
$classInfo
[
"class_id2_name"
];
$v
[
"class_id2_name"
]
=
$classInfo
[
"class_id2_name"
];
}
}
}
}
if
(
$v
[
'currency'
]
==
2
)
{
// 美元需计算汇率(排序用)
if
(
$v
[
'currency'
]
==
2
)
{
$v
[
'price_rmb'
]
=
$rate
?
number_format
(
$v
[
'price_origin'
]
*
$rate
,
6
)
:
0
;
$v
[
'price_rmb'
]
=
$rate
?
number_format
(
$v
[
'price_origin'
]
*
$rate
,
6
)
:
0
;
// 美元需计算汇率(排序用)
}
}
$quote_sn
=
$this
->
where
([
"inquiry_items_id"
=>
$inquiry_items_id
,
"raw_goods_sn"
=>
$v
[
"raw_goods_sn"
]])
->
value
(
"quote_sn"
);
$quote_sn
=
$this
->
where
([
"inquiry_items_id"
=>
$inquiry_items_id
,
"raw_goods_sn"
=>
$v
[
"raw_goods_sn"
]])
->
value
(
"quote_sn"
);
if
(
$quote_sn
){
#存在更新
if
(
$quote_sn
){
#存在更新
...
@@ -316,6 +323,16 @@ class QuoteModel extends Model
...
@@ -316,6 +323,16 @@ class QuoteModel extends Model
RedisDB
::
sadd
(
'frq_quote_urge'
,
$inquiry_items_id
);
RedisDB
::
sadd
(
'frq_quote_urge'
,
$inquiry_items_id
);
$con
->
commit
();
$con
->
commit
();
// 推送消息
$inquiry_id
=
InquiryItemsModel
::
where
(
'id'
,
$inquiry_items_id
)
->
value
(
'inquiry_id'
);
$InquiryModel
=
new
InquiryModel
;
$inquiry_uid
=
$InquiryModel
->
where
(
'id'
,
$inquiry_id
)
->
value
(
'create_uid'
);
// 询价人
$contents
=
'系统自动报价,请及时查看!'
;
$CommonModel
->
send_msg
(
$inquiry_uid
,
$contents
);
return
[
0
,
"新增成功"
];
return
[
0
,
"新增成功"
];
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$con
->
rollBack
();
$con
->
rollBack
();
...
@@ -405,7 +422,7 @@ class QuoteModel extends Model
...
@@ -405,7 +422,7 @@ class QuoteModel extends Model
$price
=
'$'
.
$quote_info
[
'price_origin'
];
$price
=
'$'
.
$quote_info
[
'price_origin'
];
}
}
$contents
=
$input
[
'user_name'
]
.
'已报价,请及时查看!报价单号:'
.
$quote_info
[
'quote_sn'
]
.
',单价:'
.
$price
;
$contents
=
$input
[
'user_name'
]
.
'已报价,请及时查看!报价单号:'
.
$quote_info
[
'quote_sn'
]
.
',
型号:'
.
$quote_info
[
'goods_name'
]
.
',
单价:'
.
$price
;
$CommonModel
->
send_msg
(
$inquiry_uid
,
$contents
);
$CommonModel
->
send_msg
(
$inquiry_uid
,
$contents
);
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
return
[
1
,
$e
->
getMessage
()];
return
[
1
,
$e
->
getMessage
()];
...
@@ -703,17 +720,48 @@ class QuoteModel extends Model
...
@@ -703,17 +720,48 @@ class QuoteModel extends Model
$quote_info
[
'brand_name'
]
=
$brand
[
0
][
'brand_name'
];
$quote_info
[
'brand_name'
]
=
$brand
[
0
][
'brand_name'
];
unset
(
$quote_info
[
'brand_s'
]);
unset
(
$quote_info
[
'brand_s'
]);
$params
=
[];
$params
[
'spu_name'
]
=
strtoupper
(
$quote_info
[
'goods_name'
]);
$params
[
'brand_name'
]
=
$quote_info
[
'brand_name'
];
$SearchModel
=
new
SearchModel
;
$res
=
$SearchModel
->
getClassName
(
json_encode
([
$params
]));
// 获取型号分类
if
(
$res
)
{
$classInfo
=
$res
[
$params
[
'spu_name'
]
.
"#"
.
strtoupper
(
$params
[
"brand_name"
])];
$quote_info
[
'class_id2'
]
=
$classInfo
[
'class_id2'
];
$quote_info
[
'class_id2_name'
]
=
$classInfo
[
'class_id2_name'
];
}
$this
->
where
(
'id'
,
$input
[
'quote_id'
])
->
update
(
$quote_info
);
$this
->
where
(
'id'
,
$input
[
'quote_id'
])
->
update
(
$quote_info
);
if
(
$quote_info
[
'currency'
]
==
1
)
{
$price
=
'¥'
.
$quote_info
[
'price_rmb'
];
$price_log
=
'含税单价:'
.
$quote_info
[
'price_rmb'
];
}
else
{
$price
=
'$'
.
$quote_info
[
'price_origin'
];
$price_log
=
'单价:'
.
$quote_info
[
'price_origin'
];
}
$content
=
'修改报价,报价单号:'
.
$input
[
'quote_sn'
]
.
',型号:'
.
$quote_info
[
'goods_name'
]
.
','
.
$price_log
.
',批次:'
.
$quote_info
[
'batch'
]
.
',货期:'
.
$quote_info
[
'delivery_time'
];
$data
=
[];
$data
=
[];
$data
[
'types'
]
=
2
;
$data
[
'types'
]
=
2
;
$data
[
'relation_id'
]
=
$input
[
'quote_id'
];
$data
[
'relation_id'
]
=
$input
[
'quote_id'
];
$data
[
'relation_sn'
]
=
$input
[
'quote_sn'
];
$data
[
'relation_sn'
]
=
$input
[
'quote_sn'
];
$data
[
'content'
]
=
'修改报价,报价单号:'
.
$input
[
'quote_sn'
]
;
$data
[
'content'
]
=
$content
;
$data
[
'create_uid'
]
=
$input
[
'user_id'
];
$data
[
'create_uid'
]
=
$input
[
'user_id'
];
$data
[
'create_name'
]
=
$input
[
'user_name'
];
$data
[
'create_name'
]
=
$input
[
'user_name'
];
OpLogModel
::
log
(
$data
);
OpLogModel
::
log
(
$data
);
// 推送消息
$InquiryModel
=
new
InquiryModel
;
$inquiry_uid
=
$InquiryModel
->
where
(
'id'
,
$input
[
'inquiry_id'
])
->
value
(
'create_uid'
);
// 询价人
$contents
=
$input
[
'user_name'
]
.
$content
;
$CommonModel
->
send_msg
(
$inquiry_uid
,
$contents
);
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
return
[
1
,
$e
->
getMessage
()];
return
[
1
,
$e
->
getMessage
()];
}
}
...
...
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