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
0c029947
authored
Mar 31, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整
parent
924de079
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletions
app/Model/CommonModel.php
app/Model/QuoteModel.php
app/Model/CommonModel.php
View file @
0c029947
...
...
@@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Model;
use
Request
;
use
DB
;
use
App\Model\CmsModel
;
use
App\Model\Mongo\SpuModel
;
//公共模型
class
CommonModel
extends
Model
...
...
@@ -203,7 +204,23 @@ class CommonModel extends Model
}
// 判断型号是否存在
public
function
isGoodsNameExists
(
$goods_name
)
{
$SpuModel
=
new
SpuModel
;
return
$SpuModel
->
where
(
'spu_name'
,
$goods_name
)
->
value
(
'_id'
);
}
// 判断品牌是否存在
public
function
isBrandNameExists
(
$brand_name
)
{
return
DB
::
connection
(
"spu"
)
->
table
(
'lie_brand'
)
->
where
(
'brand_name'
,
$brand_name
)
->
value
(
'brand_id'
);
}
// 判断供应商是否存在
public
function
isSupplierNameExists
(
$supplier_name
)
{
return
DB
::
connection
(
'ass'
)
->
table
(
'lie_supplier_channel'
)
->
where
(
'supplier_name'
,
$supplier_name
)
->
value
(
'supplier_id'
);
}
}
\ No newline at end of file
app/Model/QuoteModel.php
View file @
0c029947
...
...
@@ -556,7 +556,7 @@ class QuoteModel extends Model
$v
[
'create_time'
]
=
time
();
$v
[
'update_time'
]
=
time
();
}
dd
(
$excel
);
$res
=
$this
->
insert
(
$excel
);
// 批量插入
if
(
$res
===
false
)
return
[
1
,
'添加报价草稿失败'
];
...
...
@@ -613,6 +613,14 @@ dd($excel);
}
if
(
$val
[
'brand_name'
])
{
// 判断型号是否存在
}
if
(
$val
[
'supplier_name'
])
{
// 判断型号是否存在
}
if
(
$val
[
'currency'
]
!=
'人民币'
&&
$val
[
'price_origin'
]
<=
0
)
{
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,单价等于或小于0'
;
return
;
...
...
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