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
ea8e2f5f
authored
Mar 05, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改报价
parent
47890d55
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
app/Http/Controllers/ApiController.php
app/Model/QuoteModel.php
app/Http/Controllers/ApiController.php
View file @
ea8e2f5f
...
@@ -178,5 +178,10 @@ class ApiController extends Controller
...
@@ -178,5 +178,10 @@ class ApiController extends Controller
Export
((
new
QuoteModel
())
->
batchQuote
(
$input
));
Export
((
new
QuoteModel
())
->
batchQuote
(
$input
));
}
}
// 修改报价
public
function
ApiEditQuote
(
$input
,
$id
)
{
Export
((
new
QuoteModel
())
->
edit
(
$input
));
}
}
}
app/Model/QuoteModel.php
View file @
ea8e2f5f
...
@@ -10,6 +10,7 @@ use DB;
...
@@ -10,6 +10,7 @@ use DB;
use
App\Model\OplogModel
;
use
App\Model\OplogModel
;
use
App\Model\UserModel
;
use
App\Model\UserModel
;
use
App\Http\Controllers\PermController
;
use
App\Http\Controllers\PermController
;
use
App\Http\Controllers\ApiController
;
use
RedisDB
;
use
RedisDB
;
use
Excel
;
use
Excel
;
...
@@ -272,20 +273,24 @@ class QuoteModel extends Model
...
@@ -272,20 +273,24 @@ class QuoteModel extends Model
// 插入到报价表 -- 状态:草稿
// 插入到报价表 -- 状态:草稿
try
{
try
{
$UserModel
=
new
UserModel
;
$ApiController
=
new
ApiController
;
foreach
(
$excel
as
&
$v
)
{
foreach
(
$excel
as
&
$v
)
{
$v
[
'quote_sn'
]
=
$ApiController
->
createSn
(
$this
,
'quote_sn'
,
'B'
);
$v
[
'currency'
]
=
$v
[
'currency'
]
==
'RMB'
?
1
:
2
;
$v
[
'currency'
]
=
$v
[
'currency'
]
==
'RMB'
?
1
:
2
;
$v
[
'inquiry_id'
]
=
$input
[
'inquiry_id'
];
$v
[
'inquiry_id'
]
=
$input
[
'inquiry_id'
];
$v
[
'inquiry_sn'
]
=
$input
[
'inquiry_sn'
];
$v
[
'inquiry_sn'
]
=
$input
[
'inquiry_sn'
];
$v
[
'inquiry_items_id'
]
=
$input
[
'inquiry_items_id'
];
$v
[
'inquiry_items_id'
]
=
$input
[
'inquiry_items_id'
];
$v
[
'status'
]
=
0
;
$v
[
'status'
]
=
0
;
$v
[
'create_uid'
]
=
$input
[
'user_id'
];
$v
[
'create_name'
]
=
$UserModel
->
FinduserInfoName
(
$input
[
'user_id'
]);
$v
[
'create_time'
]
=
time
();
$v
[
'create_time'
]
=
time
();
$v
[
'update_time'
]
=
time
();
$v
[
'update_time'
]
=
time
();
}
}
$res
=
$this
->
insert
(
$excel
);
// 批量插入
$res
=
$this
->
insert
(
$excel
);
// 批量插入
if
(
$res
===
false
)
return
[
1
,
'添加报价草稿失败'
];
if
(
$res
===
false
)
return
[
1
,
'添加报价草稿失败'
];
$UserModel
=
new
UserModel
;
$data
=
[];
$data
=
[];
$data
[
'types'
]
=
2
;
$data
[
'types'
]
=
2
;
...
@@ -459,4 +464,30 @@ class QuoteModel extends Model
...
@@ -459,4 +464,30 @@ class QuoteModel extends Model
return
[
0
,
'批量提交报价成功'
];
return
[
0
,
'批量提交报价成功'
];
}
}
// 修改报价
public
function
edit
(
$input
)
{
if
(
!
$input
[
'quote_id'
])
return
[
-
1
,
'参数缺失'
];
try
{
$this
->
where
(
'id'
,
$input
[
'quote_id'
])
->
update
(
$input
[
'quote_info'
]);
$UserModel
=
new
UserModel
;
$data
=
[];
$data
[
'types'
]
=
2
;
$data
[
'relation_id'
]
=
$input
[
'quote_id'
];
$data
[
'relation_sn'
]
=
$input
[
'quote_sn'
];
$data
[
'content'
]
=
'修改报价,报价单号:'
.
$input
[
'quote_sn'
];
$data
[
'create_uid'
]
=
$input
[
'user_id'
];
$data
[
'create_name'
]
=
$UserModel
->
FinduserInfoName
(
$input
[
'user_id'
]);
OplogModel
::
log
(
$data
);
}
catch
(
Exception
$e
)
{
return
[
1
,
$e
->
getMessage
()];
}
return
[
0
,
'修改报价成功'
];
}
}
}
\ 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