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
1c83f3a3
authored
May 19, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整新增询价
parent
beed910b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
14 deletions
app/Model/InquiryItemsModel.php
app/Model/InquiryItemsReportModel.php
app/Model/InquiryModel.php
app/map/InquiryMap.php
app/Model/InquiryItemsModel.php
View file @
1c83f3a3
...
...
@@ -142,7 +142,7 @@ class InquiryItemsModel extends Model
}
if
(
@
$input
[
"inquiry_items_id"
]){
$del
=
$this
->
where
([
"id"
=>
$input
[
"inquiry_items_id"
]])
->
delete
();
$del
=
(
new
InquiryItemsReportModel
())
->
where
([
"id"
=>
$input
[
"inquiry_items_id"
]])
->
delete
();
#同步输出报价表
$del
=
(
new
InquiryItemsReportModel
())
->
where
([
"i
nquiry_items_i
d"
=>
$input
[
"inquiry_items_id"
]])
->
delete
();
#同步输出报价表
}
return
[
0
,
"删除成功"
];
}
...
...
@@ -238,17 +238,19 @@ class InquiryItemsModel extends Model
"update_time"
=>
time
()
,
];
if
(
isset
(
$b
[
'not_quote'
])
&&
$b
[
'not_quote'
]
==
'on'
)
{
$insertArr
[
'status'
]
=
-
2
;
// 无需报价
if
(
isset
(
$b
[
'no_quote'
])
&&
$b
[
'no_quote'
]
==
'on'
)
{
// 无需报价,询价状态变为已确定
$insertArr
[
'no_quote'
]
=
1
;
$insertArr
[
'status'
]
=
5
;
}
$inquiryItemsId
=
$this
->
insertGetId
(
$insertArr
);
#插入销售报价表
(
new
InquiryItemsReportModel
())
->
insert
([
"inquiry_id"
=>
$b
[
"inquiry_id"
]
,
"inquiry_items_id"
=>
$inquiryItemsId
,
]);
$reportArr
=
[];
$reportArr
[
'inquiry_id'
]
=
$b
[
'inquiry_id'
];
$reportArr
[
'inquiry_items_id'
]
=
$inquiryItemsId
;
(
new
InquiryItemsReportModel
())
->
insert
(
$reportArr
);
#插入指定领取人
if
(
$b
[
"pur_s"
]
!==
""
){
...
...
@@ -329,7 +331,14 @@ class InquiryItemsModel extends Model
"update_time"
=>
time
()
,
];
$updateArr
[
'status'
]
=
isset
(
$b
[
'not_quote'
])
&&
$b
[
'not_quote'
]
==
'on'
?
-
2
:
1
;
// 无需报价没勾选,则默认为待报价
// 无需报价没勾选,则默认为待报价
if
(
isset
(
$b
[
'is_quote'
])
&&
$b
[
'is_quote'
]
==
'on'
)
{
$updateArr
[
'no_quote'
]
=
1
;
$updateArr
[
'status'
]
=
5
;
}
else
{
$updateArr
[
'no_quote'
]
=
-
1
;
$updateArr
[
'status'
]
=
1
;
}
$this
->
where
(
"id"
,
$inquiry_items_id
)
->
update
(
$updateArr
);
...
...
app/Model/InquiryItemsReportModel.php
View file @
1c83f3a3
...
...
@@ -228,7 +228,7 @@ class InquiryItemsReportModel extends Model
$itemsIdArr
=
explode
(
","
,
$input
[
"inquiry_items_ids"
]);
$InquiryItemsModel
=
new
InquiryItemsModel
();
if
(
$types
==
1
){
$check
=
$InquiryItemsModel
->
whereIn
(
"status"
,[
3
,
4
,
5
])
->
whereIn
(
"id"
,
$itemsIdArr
)
->
count
();
$check
=
$InquiryItemsModel
->
whereIn
(
"status"
,[
-
2
,
3
,
4
,
5
])
->
whereIn
(
"id"
,
$itemsIdArr
)
->
count
();
}
else
{
$check
=
$InquiryItemsModel
->
where
(
"status"
,
5
)
->
whereIn
(
"id"
,
$itemsIdArr
)
->
count
();
}
...
...
app/Model/InquiryModel.php
View file @
1c83f3a3
...
...
@@ -186,7 +186,7 @@ class InquiryModel extends Model
}
}
$v
[
'no_quote_val'
]
=
$v
[
'no_quote'
]
==
1
?
'是'
:
'否'
;
}
$data
=
$list
[
'data'
];
if
(
@
$input
[
"is_export"
]
==
1
)
{
#如果是导出
...
...
@@ -300,7 +300,7 @@ class InquiryModel extends Model
*/
if
(
$type
==
1
)
{
$query
->
where
(
'a.status'
,
1
)
->
whereNotIn
(
'b.status'
,
[
-
2
,
-
1
,
5
])
->
whereNotIn
(
'b.status'
,
[
-
1
,
5
])
->
where
(
'b.assign_type'
,
2
)
->
whereRaw
(
'(lie_c.assign_uid != '
.
$user_id
.
' or lie_c.assign_uid is NULL)'
);
...
...
@@ -466,6 +466,36 @@ class InquiryModel extends Model
$data
[
"com_name"
]
=
$user
[
0
][
"name"
];
}
$check
=
$inqueryId
=
$this
->
where
(
"id"
,
$input
[
"inquiry_id"
])
->
update
(
$data
);
// 检查询价明细是否需要报价,若无需报价则更新询价明细报价表
$inquiry_items
=
(
new
InquiryItemsModel
())
->
where
(
"inquiry_id"
,
$inquiry_id
)
->
get
()
->
toArray
();
foreach
(
$inquiry_items
as
$item
)
{
if
(
$item
[
'no_quote'
]
==
-
1
)
continue
;
$reportArr
=
[];
$reportArr
[
'goods_name'
]
=
$item
[
'goods_name'
];
$reportArr
[
'goods_name_pro'
]
=
$item
[
'goods_name'
];
$reportArr
[
'brand_id'
]
=
$item
[
'brand_id'
];
$reportArr
[
'brand_name'
]
=
$item
[
'brand_name'
];
$reportArr
[
'supplier_name'
]
=
'猎芯联营'
;
$reportArr
[
'inquiry_number'
]
=
$item
[
'inquiry_number'
];
$reportArr
[
'currency'
]
=
$input
[
"delivery_place"
];
if
(
$input
[
"delivery_place"
]
==
1
)
{
$reportArr
[
'price_rmb'
]
=
$item
[
'target_price'
];
}
else
{
$reportArr
[
'price_origin'
]
=
$item
[
'target_price'
];
}
$reportArr
[
'delivery_time'
]
=
$item
[
'delivery_time'
];
$reportArr
[
'class_id2'
]
=
$item
[
'class_id2'
];
$reportArr
[
'class_id2_name'
]
=
$item
[
'class_id2_name'
];
$reportArr
[
'batch'
]
=
$item
[
'batch'
];
(
new
InquiryItemsReportModel
())
->
where
(
"inquiry_items_id"
,
$item
[
'id'
])
->
update
(
$reportArr
);
}
return
[
0
,
"操作成功"
];
}
...
...
app/map/InquiryMap.php
View file @
1c83f3a3
...
...
@@ -3,8 +3,7 @@ namespace App\map;
//询价枚举
class
InquiryMap
{
//状态 -2:无需报价 -1:已关闭 1:待报价 2:已报价 3:已选中 4:已领取 5:已确认
const
status_not_quote
=
-
2
;
//状态 -1:已关闭 1:待报价 2:已报价 3:已选中 4:已领取 5:已确认
const
status_close
=
-
1
;
const
status_ready
=
1
;
const
status_replay
=
2
;
...
...
@@ -12,7 +11,6 @@ class InquiryMap{
const
status_fix
=
4
;
const
status_sure
=
5
;
static
$status
=
[
self
::
status_not_quote
=>
"无需报价"
,
self
::
status_close
=>
"已关闭"
,
self
::
status_ready
=>
"待报价"
,
self
::
status_replay
=>
"已报价"
,
...
...
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