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
efa426cd
authored
Mar 04, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
撤销报价
parent
1d90d9ff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
app/Http/Controllers/ApiController.php
app/Model/QuoteModel.php
app/Http/Controllers/ApiController.php
View file @
efa426cd
...
@@ -123,15 +123,15 @@ class ApiController extends Controller
...
@@ -123,15 +123,15 @@ class ApiController extends Controller
}
}
//报价列表
//报价列表
public
function
ApiQuoteList
(
$
reques
t
,
$id
)
public
function
ApiQuoteList
(
$
inpu
t
,
$id
)
{
{
ExportLayui
((
new
QuoteModel
())
->
lists
(
$
reques
t
));
ExportLayui
((
new
QuoteModel
())
->
lists
(
$
inpu
t
));
}
}
// 撤销报价
// 撤销报价
public
function
ApiCancelQuote
(
$
reques
t
,
$id
)
public
function
ApiCancelQuote
(
$
inpu
t
,
$id
)
{
{
Export
((
new
QuoteModel
())
->
cancel
(
$
reques
t
));
Export
((
new
QuoteModel
())
->
cancel
(
$
inpu
t
));
}
}
// 新增报价
// 新增报价
...
...
app/Model/QuoteModel.php
View file @
efa426cd
...
@@ -75,20 +75,20 @@ class QuoteModel extends Model
...
@@ -75,20 +75,20 @@ class QuoteModel extends Model
}
}
// 获取报价列表
// 获取报价列表
public
function
lists
(
$
reques
t
,
$export
=
''
)
public
function
lists
(
$
inpu
t
,
$export
=
''
)
{
{
$page
=
$
request
->
input
(
'page'
,
1
)
;
$page
=
$
input
[
'page'
]
;
$limit
=
$
request
->
input
(
'limit'
,
10
)
;
$limit
=
$
input
[
'limit'
]
;
$type
=
$
request
->
input
(
'type'
,
1
)
;
// 1-我的报价,2-所有报价
$type
=
$
input
[
'type'
]
;
// 1-我的报价,2-所有报价
$map
[
'inquiry_sn'
]
=
$request
->
input
(
'inquiry_sn'
,
''
)
;
// 询价单号
$map
[
'inquiry_sn'
]
=
isset
(
$input
[
'inquiry_sn'
])
?
$input
[
'inquiry_sn'
]
:
''
;
// 询价单号
$map
[
'goods_name'
]
=
$request
->
input
(
'goods_name'
,
''
)
;
// 型号
$map
[
'goods_name'
]
=
isset
(
$input
[
'goods_name'
])
?
$input
[
'goods_name'
]
:
''
;
// 型号
$map
[
'brand_name'
]
=
$request
->
input
(
'brand_name'
,
''
)
;
// 品牌
$map
[
'brand_name'
]
=
isset
(
$input
[
'brand_name'
])
?
$input
[
'brand_name'
]
:
''
;
// 品牌
$map
[
'quote_sn'
]
=
$request
->
input
(
'quote_sn'
,
''
)
;
// 报价单号
$map
[
'quote_sn'
]
=
isset
(
$input
[
'quote_sn'
])
?
$input
[
'quote_sn'
]
:
''
;
// 报价单号
$map
[
'status'
]
=
$request
->
input
(
'status'
,
''
)
;
// 报价状态
$map
[
'status'
]
=
isset
(
$input
[
'status'
])
?
$input
[
'status'
]
:
''
;
// 报价状态
$map
[
'create_uid'
]
=
$request
->
input
(
'create_uid'
,
''
)
;
// 报价制单人
$map
[
'create_uid'
]
=
isset
(
$input
[
'create_uid'
])
?
$input
[
'create_uid'
]
:
''
;
// 报价制单人
$map
[
'start_time'
]
=
$request
->
input
(
'start_time'
,
''
)
?
strtotime
(
$request
->
input
(
'start_time'
)
)
:
''
;
$map
[
'start_time'
]
=
isset
(
$input
[
'start_time'
])
?
strtotime
(
$input
[
'start_time'
]
)
:
''
;
$map
[
'end_time'
]
=
$request
->
input
(
'end_time'
,
''
)
?
strtotime
(
$request
->
input
(
'end_time'
)
)
+
86399
:
''
;
$map
[
'end_time'
]
=
isset
(
$input
[
'end_time'
])
?
strtotime
(
$input
[
'end_time'
]
)
+
86399
:
''
;
$field
=
[
'q.id'
,
'q.inquiry_id'
,
'q.inquiry_sn'
,
'q.quote_sn'
,
'q.source'
,
'q.price_origin'
,
'q.price_rmb'
,
'q.price_other'
,
'q.currency'
,
'q.supplier_id'
,
'q.supplier_name'
,
'q.quote_number'
,
'q.status'
,
'q.create_uid'
,
'q.create_name'
,
'q.create_time'
,
'it.goods_name'
,
'it.brand_name'
,
'it.inquiry_number'
];
$field
=
[
'q.id'
,
'q.inquiry_id'
,
'q.inquiry_sn'
,
'q.quote_sn'
,
'q.source'
,
'q.price_origin'
,
'q.price_rmb'
,
'q.price_other'
,
'q.currency'
,
'q.supplier_id'
,
'q.supplier_name'
,
'q.quote_number'
,
'q.status'
,
'q.create_uid'
,
'q.create_name'
,
'q.create_time'
,
'it.goods_name'
,
'it.brand_name'
,
'it.inquiry_number'
];
...
@@ -126,13 +126,13 @@ class QuoteModel extends Model
...
@@ -126,13 +126,13 @@ class QuoteModel extends Model
});
});
if
(
$type
==
1
)
{
if
(
$type
==
1
)
{
$list
=
$list
->
where
(
'q.create_uid'
,
$
request
->
user
->
userId
);
$list
=
$list
->
where
(
'q.create_uid'
,
$
input
[
'user_id'
]
);
}
else
{
}
else
{
$perm
=
new
PermController
;
$perm
=
new
PermController
;
$role
=
$perm
->
getUserRole
(
$
request
->
user
->
userId
,
$request
->
user
->
name
);
// 用户角色
$role
=
$perm
->
getUserRole
(
$
input
[
'user_id'
],
$input
[
'user_name'
]
);
// 用户角色
if
(
$role
==
4
)
{
// 采购查看下级
if
(
$role
==
4
)
{
// 采购查看下级
$sub_sale_ids
=
$perm
->
getSubSaleId
(
$
request
->
user
->
userId
);
$sub_sale_ids
=
$perm
->
getSubSaleId
(
$
input
[
'user_id'
]
);
$list
=
$list
->
whereIn
(
'q.create_uid'
,
$sub_sale_ids
);
$list
=
$list
->
whereIn
(
'q.create_uid'
,
$sub_sale_ids
);
}
}
}
}
...
@@ -175,10 +175,10 @@ class QuoteModel extends Model
...
@@ -175,10 +175,10 @@ class QuoteModel extends Model
}
}
// 撤销
// 撤销
public
function
cancel
(
$
reques
t
)
public
function
cancel
(
$
inpu
t
)
{
{
$id
=
$
request
->
input
(
'id'
,
0
)
;
$id
=
$
input
[
'id'
]
;
$cancel_reason
=
$
request
->
input
(
'cancel_reason'
,
''
)
;
$cancel_reason
=
$
input
[
'cancel_reason'
]
;
if
(
!
$id
)
return
[
-
1
,
'参数缺失'
];
if
(
!
$id
)
return
[
-
1
,
'参数缺失'
];
...
@@ -193,8 +193,8 @@ class QuoteModel extends Model
...
@@ -193,8 +193,8 @@ class QuoteModel extends Model
$data
[
'relation_id'
]
=
$id
;
$data
[
'relation_id'
]
=
$id
;
$data
[
'relation_sn'
]
=
$quote_info
[
'quote_sn'
];
$data
[
'relation_sn'
]
=
$quote_info
[
'quote_sn'
];
$data
[
'content'
]
=
'撤销报价,撤销原因:'
.
$cancel_reason
.
',报价单号:'
.
$quote_info
[
'quote_sn'
];
$data
[
'content'
]
=
'撤销报价,撤销原因:'
.
$cancel_reason
.
',报价单号:'
.
$quote_info
[
'quote_sn'
];
$data
[
'create_uid'
]
=
$
request
->
user
->
userId
;
$data
[
'create_uid'
]
=
$
input
[
'user_id'
]
;
$data
[
'create_name'
]
=
$UserModel
->
FinduserInfoName
(
$
request
->
user
->
userId
);
$data
[
'create_name'
]
=
$UserModel
->
FinduserInfoName
(
$
input
[
'user_id'
]
);
OplogModel
::
log
(
$data
);
OplogModel
::
log
(
$data
);
...
...
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