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
261ac9f2
authored
Jun 08, 2021
by
连敬荣
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
代码重构
parent
7d2761e2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
4 deletions
app/Http/Controllers/DataController.php
app/Http/routes/api.php
app/Model/InquiryItemsAssignModel.php
app/Model/InquiryItemsModel.php
app/Model/InquiryItemsReportModel.php
app/Model/InquiryModel.php
app/Model/InquiryUsersModel.php
app/Http/Controllers/DataController.php
View file @
261ac9f2
This diff is collapsed.
Click to expand it.
app/Http/routes/api.php
View file @
261ac9f2
...
...
@@ -6,4 +6,5 @@ Route::Get('/ApiBrandList','SearchController@getBrandList');//新增询价查询
Route
::
Post
(
'/ApiCheckGoods'
,
'SearchController@checkUniqueGoods'
);
//检查是否已经存在询价单;
Route
::
Post
(
'/ApiCreateOneItems'
,
'DataController@createInquiryItemsDetail'
);
//创建一条询价明细;
Route
::
Post
(
'/api/ApiDeleteInquiryItems'
,
'DataController@deleteInquiryItemsDetail'
);
//删除询价明细;
//
Route
::
Post
(
'/api/ApiEditInquiry'
,
'DataController@ApiEditInquiry'
);
//
新增询价
;
\ No newline at end of file
Route
::
Post
(
'/api/ApiEditInquiry'
,
'DataController@creatInquiry'
);
//新增询价;
Route
::
Post
(
'/ApiUpdateOneItems'
,
'DataController@editInquiryItemDetail'
);
//
修改单条明细记录
;
\ No newline at end of file
app/Model/InquiryItemsAssignModel.php
View file @
261ac9f2
...
...
@@ -68,6 +68,15 @@ class InquiryItemsAssignModel extends Model
return
$this
->
where
(
$map
)
->
delete
();
}
public
function
clearOutAssign
(
$inquiry_items_id
){
//清空指定人
$this
->
where
(
"inquiry_items_id"
,
$inquiry_items_id
)
->
delete
();
}
public
function
insertAssign
(
$assignInsert
){
//插入指定人
$this
->
insert
(
$assignInsert
);
}
public
function
getAssignInfo
(
$inquiry_items_id
){
$assignInfo
=
$this
->
select
(
"assign_uid"
)
->
where
(
"inquiry_items_id"
,
$inquiry_items_id
)
->
get
();
return
$assignInfo
;
}
}
\ No newline at end of file
app/Model/InquiryItemsModel.php
View file @
261ac9f2
...
...
@@ -665,4 +665,20 @@ class InquiryItemsModel extends Model
public
function
updateInquiryItemsStatus
(
$inquiryItemsId
,
$status
){
$this
->
where
(
'id'
,
$inquiryItemsId
)
->
update
([
'status'
=>
$status
]);
// 存在指定采购,则标记状态为已领取
}
public
function
hasItems
(
$inquiry_id
){
//判断是否存在明细
$hasItems
=
$this
->
where
(
"inquiry_id"
,
$inquiry_id
)
->
count
();
return
$hasItems
;
}
public
function
getInquiryItems
(
$inquiry_id
){
$inquiry_items
=
(
new
InquiryItemsModel
())
->
where
(
"inquiry_id"
,
$inquiry_id
)
->
get
()
->
toArray
();
return
$inquiry_items
;
}
public
function
updateInquiryItemsDetail
(
$inquiry_items_id
,
$updateArr
){
$this
->
where
(
"id"
,
$inquiry_items_id
)
->
update
(
$updateArr
);
}
public
function
getItemArr
(
$inquiry_items_id
){
$itemArr
=
$this
->
where
(
"id"
,
$inquiry_items_id
)
->
first
()
->
toArray
();
#明细
return
$itemArr
;
}
}
\ No newline at end of file
app/Model/InquiryItemsReportModel.php
View file @
261ac9f2
...
...
@@ -236,5 +236,8 @@ class InquiryItemsReportModel extends Model
return
$check
!=
count
(
$itemsIdArr
)
?
[
1001
,
$types
==
1
?
"存在没选中的询价单!"
:
"存在没确定的询价单!"
]
:
[
0
,
"通过"
];
}
public
function
updateIquiryItemsReport
(
$item
,
$reportArr
){
$this
->
where
(
"inquiry_items_id"
,
$item
[
'id'
])
->
update
(
$reportArr
);
}
}
\ No newline at end of file
app/Model/InquiryModel.php
View file @
261ac9f2
...
...
@@ -571,6 +571,9 @@ class InquiryModel extends Model
$res
=
$con
->
select
(
$sql1
);
return
@
$res
[
0
][
"count"
];
}
public
function
getMainArr
(
$itemArr
){
//获取主表单状态
$mainArr
=
$this
->
where
(
"id"
,
$itemArr
[
"inquiry_id"
])
->
first
()
->
toArray
();
return
$mainArr
;
}
}
\ No newline at end of file
app/Model/InquiryUsersModel.php
View file @
261ac9f2
...
...
@@ -20,5 +20,13 @@ class InquiryUsersModel extends Model
protected
$primaryKey
=
'id'
;
public
$timestamps
=
false
;
public
function
getUserInfo
(
$input
,
$user
){
$userInfo
=
(
new
InquiryUsersModel
())
->
where
([
"create_uid"
=>
$input
[
"user_id"
],
"user_name"
=>
$user
[
0
][
"name"
]])
->
first
();
return
$userInfo
;
}
public
function
getUserId
(
$input
,
$user
){
$userId
=
$this
->
insertGetId
([
"create_uid"
=>
$input
[
"user_id"
],
"user_name"
=>
$user
[
0
][
"name"
],
"create_time"
=>
time
()]);
return
$userId
;
}
}
\ No newline at end of file
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