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
5add41e2
authored
Nov 27, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
根据组织判断显示类型
parent
c5ffddb1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
13 deletions
app/Http/Services/BaseService.php
app/Http/Services/SkuService.php
app/Providers/AppServiceProvider.php
config/field.php
resources/views/web/BatchUpdateGoodsLabel.blade.php
resources/views/web/sku/SkuListFilter.blade.php
app/Http/Services/BaseService.php
0 → 100644
View file @
5add41e2
<?php
namespace
App\Http\Services
;
//后台用户相关信息服务
use
App\Model\SupplierBlacklistModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Support\Facades\DB
;
class
BaseService
{
public
$logId
=
1
;
public
function
__construct
()
{
$this
->
orgId
=
!
empty
(
request
()
->
user
->
org_id
)
?
request
()
->
user
->
org_id
:
1
;
}
}
app/Http/Services/SkuService.php
View file @
5add41e2
...
...
@@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Redis;
use
PhpAmqpLib\Connection\AMQPStreamConnection
;
use
PhpAmqpLib\Message\AMQPMessage
;
class
SkuService
class
SkuService
extends
BaseService
{
const
OPERATE_TYPE_PUTAWAY
=
1
;
...
...
@@ -108,7 +108,11 @@ class SkuService
//获取是否精选和标签
$goodsTag
=
$this
->
getGoodsTag
(
$sku
[
'goods_id'
]);
$sku
[
'goods_label'
]
=
array_get
(
$goodsTag
,
'goods_label'
,
''
);
$sku
[
'goods_label_name'
]
=
array_get
(
config
(
'field.SkuGoodsLabel'
),
$sku
[
'goods_label'
],
''
);
if
(
$this
->
orgId
==
1
)
{
$sku
[
'goods_label_name'
]
=
array_get
(
config
(
'field.SkuGoodsLabel'
),
$sku
[
'goods_label'
],
''
);
}
else
{
$sku
[
'goods_label_name'
]
=
array_get
(
config
(
'field.SkuGoodsLabelForIedge'
),
$sku
[
'goods_label'
],
''
);
}
$sku
[
'tags'
]
=
array_get
(
$goodsTag
,
'tags'
,
[]);
if
(
!
empty
(
$sku
[
'tags'
]))
{
$sku
[
'is_prefer'
]
=
in_array
(
1
,
$sku
[
'tags'
])
?
1
:
0
;
...
...
@@ -136,7 +140,7 @@ class SkuService
$dbInfo
=
getSpuSkuDb
(
$item
[
'goods_id'
]);
$connection
=
DB
::
connection
(
$dbInfo
[
"db"
]);
$table
=
$dbInfo
[
'table'
];
$selectFields
=
[
'goods_id'
,
'create_time'
,
'eccn'
,
'source'
,
'encoded'
,
'org_id'
];
$selectFields
=
[
'goods_id'
,
'create_time'
,
'eccn'
,
'source'
,
'encoded'
,
'org_id'
];
$skuDBData
=
$connection
->
table
(
$table
)
->
select
(
$selectFields
)
->
where
(
'goods_id'
,
$item
[
'goods_id'
])
->
first
();
$skuDBData
=
$skuDBData
?
$skuDBData
:
[];
$item
[
'source_name'
]
=
array_get
(
config
(
'field.SkuSource'
),
@
$skuDBData
[
'source'
],
''
);
...
...
@@ -506,7 +510,7 @@ class SkuService
}
else
{
$goodsTag
=
[
'goods_label'
=>
$goodsLabel
,
];
}
$redis
->
hset
(
'goods_tag'
,
$skuId
,
json_encode
(
$goodsTag
));
...
...
app/Providers/AppServiceProvider.php
View file @
5add41e2
...
...
@@ -2,6 +2,7 @@
namespace
App\Providers
;
use
Illuminate\Support\Facades\View
;
use
Illuminate\Support\ServiceProvider
;
class
AppServiceProvider
extends
ServiceProvider
...
...
@@ -13,7 +14,10 @@ class AppServiceProvider extends ServiceProvider
*/
public
function
boot
()
{
//
//共享全局模板变量
$orgId
=
!
empty
(
request
()
->
user
->
orgId
)
?
request
()
->
user
->
orgId
:
1
;
View
::
share
(
'orgId'
,
$orgId
);
View
::
share
(
'isIedge'
,
$orgId
==
1
?
false
:
true
);
}
/**
...
...
config/field.php
View file @
5add41e2
...
...
@@ -53,6 +53,16 @@ return [
-
1
=>
'代购现货'
],
'SkuGoodsLabelForIedge'
=>
[
1
=>
'华云现货'
,
2
=>
'国际现货'
,
3
=>
'华云期货'
,
4
=>
'询价现货'
,
5
=>
'原厂直售'
,
6
=>
'猎芯精选'
,
-
1
=>
'代购现货'
],
//SKU 标签
'SkuTag'
=>
[
1
=>
'优选'
,
...
...
resources/views/web/BatchUpdateGoodsLabel.blade.php
View file @
5add41e2
...
...
@@ -56,7 +56,7 @@
<div
class=
"layui-form-item"
style=
"margin-left: -50px"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('goods_label','SKU显示类型 : ',null,
config('field.SkuGoodsLabel'),['required'=>true,'label_width'=>'100px']) !!}
$isIedge?config('field.SkuGoodsLabelForIedge'):
config('field.SkuGoodsLabel'),['required'=>true,'label_width'=>'100px']) !!}
</div>
<div
align=
"center"
style=
"margin-top: 10px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
...
...
resources/views/web/sku/SkuListFilter.blade.php
View file @
5add41e2
...
...
@@ -79,18 +79,12 @@
</div>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('goods_label/condition','SKU显示类型','',config('field.SkuGoodsLabel')) !!}
{!! $statusPresenter->render('goods_label/condition','SKU显示类型','',
$isIedge?config('field.SkuGoodsLabelForIedge'):
config('field.SkuGoodsLabel')) !!}
</div>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('tags/condition','是否精选',request()->get('tags/condition'),[1=>'是',0=>'否']) !!}
</div>
{{--
<div
class=
"layui-inline"
>
--}}
{{-- @inject('statusPresenter','App\Presenters\StatusPresenter')--}}
{{-- {!! $statusPresenter->render('status/condition','是否过期',request()->get('status/condition'),[0=>'是',1=>'否']) !!}--}}
{{--
</div>
--}}
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
起订量库存
</label>
<div
class=
"layui-input-inline"
>
...
...
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