Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
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
34f41845
authored
Aug 28, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复bug
parent
7ceaea68
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
8 deletions
app/Http/Controllers/Api/SupplierMemoApiController.php
app/Http/Services/DataService.php
app/Http/Services/SupplierService.php
resources/views/script/supplier/SupplierMemoScript.blade.php
resources/views/web/SaveSupplierMemo.blade.php
app/Http/Controllers/Api/SupplierMemoApiController.php
View file @
34f41845
...
...
@@ -42,7 +42,12 @@ class SupplierMemoApiController extends Controller
$this
->
response
(
-
1
,
'标题不能为空'
);
}
if
(
empty
(
$data
[
'content'
]))
{
if
(
strlen
(
$data
[
'title'
])
>
30
)
{
$this
->
response
(
-
1
,
'标题长度不能超过30个字符串'
);
}
if
(
empty
(
strip_tags
(
$data
[
'content'
])))
{
$this
->
response
(
-
1
,
'内容不能为空'
);
}
$result
=
(
new
SupplierMemoService
())
->
saveSupplierMemo
(
$data
);
...
...
app/Http/Services/DataService.php
View file @
34f41845
...
...
@@ -1604,9 +1604,9 @@ class DataService
foreach
(
$suppliers
as
$supplier
)
{
$uploadRuler
=
$supplier
[
'sku_upload_ruler'
];
$uploadRuler
=
json_decode
(
$uploadRuler
,
true
);
$uploadRuler
[
'futures_allow_stock_lte_0'
]
=
0
;
$uploadRuler
[
'futures_allow_stock_lte_0'
]
=
1
;
$uploadRuler
[
'futures_allow_moq_lte_0'
]
=
0
;
$uploadRuler
[
'futures_allow_price_null'
]
=
0
;
$uploadRuler
[
'futures_allow_price_null'
]
=
1
;
$uploadRuler
=
json_encode
(
$uploadRuler
);
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplier
[
'supplier_id'
])
->
update
([
'sku_upload_ruler'
=>
$uploadRuler
,
...
...
app/Http/Services/SupplierService.php
View file @
34f41845
...
...
@@ -179,9 +179,11 @@ class SupplierService
$channel
=
array_except
(
$channel
,
$contactField
);
$channel
[
'channel_uid'
]
=
$contact
[
'can_check_uids'
];
$channel
[
'sku_upload_ruler'
]
=
$this
->
getInitSkuUploadRuler
();
//插入供应商返回供应商id
$supplierId
=
$this
->
newSupplierId
=
$model
->
insertGetId
(
$channel
);
$this
->
saveSkuUploadRulerToRedis
(
$supplierId
,
$channel
[
'sku_upload_ruler'
]);
//添加联系人
//要有数据才新增,麻烦得要死
if
(
!
checkArrayAllValueNull
(
$contact
))
{
...
...
@@ -419,7 +421,7 @@ class SupplierService
}
//初始化过期天数限制
public
function
initialCpTimeDays
(
$supplierId
,
$supplierGroup
)
public
function
initialCpTimeDays
(
$supplierId
,
$supplierGroup
)
{
$cpTimeDay
=
7
;
$futuresCpTimeDay
=
365
;
...
...
@@ -829,4 +831,9 @@ class SupplierService
return
$supplier
;
}
}
\ No newline at end of file
public
function
getInitSkuUploadRuler
()
{
return
'{"allow_stock_lte_0":0,"allow_moq_lte_0":0,"allow_stock_lt_moq":0,"allow_price_null":0,"futures_allow_stock_lte_0":1,"futures_allow_moq_lte_0":0,"futures_allow_price_null":1}'
;
}
}
resources/views/script/supplier/SupplierMemoScript.blade.php
View file @
34f41845
...
...
@@ -63,7 +63,7 @@
let
id
=
data
.
id
;
layer
.
open
({
type
:
2
,
content
:
'/supplier_memo/SaveSupplierMemo?view=iframe&id='
+
id
,
content
:
'/supplier_memo/SaveSupplierMemo?view=iframe&id='
+
id
+
'&supplier_id='
+
supplierId
,
area
:
[
'80%'
,
'80%'
],
title
:
'修改备忘'
,
end
:
function
()
{
...
...
resources/views/web/SaveSupplierMemo.blade.php
View file @
34f41845
...
...
@@ -18,6 +18,8 @@
value=
"{{$memo['title'] or ''}}"
>
</div>
</div>
<input
type=
"hidden"
name=
"id"
id=
"id"
value=
"{{$memo['id'] or ''}}"
>
{{--
<input
type=
"hidden"
name=
"supplier_id"
id=
"supplier_id"
value=
"{{$memo['supplier_id'] or ''}}"
>
--}}
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
内容 :
</label>
<div
class=
"layui-input-block block-42"
>
...
...
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