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
89d76014
authored
Nov 29, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into ysx-供应商财务信息增加中转行-20241125
parents
2a1518ab
14e185fb
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
70 additions
and
32 deletions
.env
app/Http/Controllers/IndexController.php
app/Http/Controllers/SkuController.php
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/Index.blade.php
resources/views/web/sku/SkuListFilter.blade.php
.env
View file @
89d76014
...
...
@@ -154,7 +154,7 @@ MENU_ID=16
MENU_URL=http://data.liexin.net/api/config/
FOOTSTONE_URL=http://footstone.liexindev.net
#标签系统的地址
TAG_URL=http://192.168.1.1
8
:32581
TAG_URL=http://192.168.1.1
7
:32581
SKIP_SEND_EMAIL=true
...
...
app/Http/Controllers/IndexController.php
View file @
89d76014
...
...
@@ -47,22 +47,27 @@ class IndexController extends Controller
public
function
Index
(
$request
)
{
$service
=
new
IndexService
();
$statistics
=
$service
->
getDailySupplierAddStatistics
();
$this
->
data
[
'dates'
]
=
array_values
(
array_column
(
$statistics
[
'all'
],
'date'
));
$this
->
data
[
'all_increase_statistics'
]
=
array_values
(
array_column
(
$statistics
[
'all'
],
'count'
));
$this
->
data
[
'user_increase_statistics'
]
=
array_values
(
array_column
(
$statistics
[
'user'
],
'count'
));
$intraCodeModel
=
new
IntracodeModel
();
$userCodes
=
$intraCodeModel
->
getSampleEncode
();
$this
->
data
[
'user'
]
=
$userCodes
;
$this
->
data
[
'purchase_users'
]
=
[];
foreach
(
$userCodes
as
$userId
=>
$code
)
{
$this
->
data
[
'purchase_users'
][]
=
[
'name'
=>
$code
,
'value'
=>
$userId
,
];
try
{
$statistics
=
$service
->
getDailySupplierAddStatistics
();
$this
->
data
[
'dates'
]
=
array_values
(
array_column
(
$statistics
[
'all'
],
'date'
));
$this
->
data
[
'all_increase_statistics'
]
=
array_values
(
array_column
(
$statistics
[
'all'
],
'count'
));
$this
->
data
[
'user_increase_statistics'
]
=
array_values
(
array_column
(
$statistics
[
'user'
],
'count'
));
$intraCodeModel
=
new
IntracodeModel
();
$userCodes
=
$intraCodeModel
->
getSampleEncode
();
$this
->
data
[
'user'
]
=
$userCodes
;
$this
->
data
[
'purchase_users'
]
=
[];
foreach
(
$userCodes
as
$userId
=>
$code
)
{
$this
->
data
[
'purchase_users'
][]
=
[
'name'
=>
$code
,
'value'
=>
$userId
,
];
}
}
catch
(
\Exception
$exception
)
{
}
return
$this
->
view
(
'首页'
);
}
}
\ No newline at end of file
}
app/Http/Controllers/SkuController.php
View file @
89d76014
...
...
@@ -44,7 +44,9 @@ class SkuController extends Controller
public
function
SkuList
(
$request
)
{
$orgId
=
!
empty
(
request
()
->
user
->
org_id
)
?
request
()
->
user
->
org_id
:
1
;
$this
->
data
[
'isIedge'
]
=
$orgId
==
1
?
false
:
true
;
$this
->
data
[
'orgId'
]
=
$orgId
;
$skuTags
=
TagsModel
::
getTagNamesByTagUse
(
16
,
2
);
$this
->
data
[
'skuTags'
]
=
$skuTags
;
//获取筛选框的品牌数据
...
...
@@ -125,6 +127,9 @@ class SkuController extends Controller
//批量设置sku显示类型
public
function
BatchUpdateGoodsLabel
(
$request
)
{
$orgId
=
!
empty
(
request
()
->
user
->
org_id
)
?
request
()
->
user
->
org_id
:
1
;
$this
->
data
[
'isIedge'
]
=
$orgId
==
1
?
false
:
true
;
$this
->
data
[
'orgId'
]
=
$orgId
;
$this
->
data
[
'title'
]
=
'批量设置sku显示类型'
;
$suppliers
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'status'
,
2
)
->
select
([
'supplier_name'
,
'supplier_code'
])
->
get
();
...
...
app/Http/Services/BaseService.php
0 → 100644
View file @
89d76014
<?php
namespace
App\Http\Services
;
//后台用户相关信息服务
use
App\Model\SupplierBlacklistModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Support\Facades\DB
;
class
BaseService
{
public
$orgId
=
1
;
public
function
__construct
()
{
$this
->
orgId
=
!
empty
(
request
()
->
user
->
org_id
)
?
request
()
->
user
->
org_id
:
1
;
}
}
app/Http/Services/SkuService.php
View file @
89d76014
...
...
@@ -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 @
89d76014
...
...
@@ -2,6 +2,7 @@
namespace
App\Providers
;
use
Illuminate\Support\Facades\View
;
use
Illuminate\Support\ServiceProvider
;
class
AppServiceProvider
extends
ServiceProvider
...
...
@@ -13,7 +14,8 @@ class AppServiceProvider extends ServiceProvider
*/
public
function
boot
()
{
//
//共享全局模板变量
}
/**
...
...
config/field.php
View file @
89d76014
...
...
@@ -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 @
89d76014
...
...
@@ -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/Index.blade.php
View file @
89d76014
...
...
@@ -98,4 +98,4 @@
let
admin
=
layui
.
admin
;
});
</script>
\ No newline at end of file
</script>
resources/views/web/sku/SkuListFilter.blade.php
View file @
89d76014
...
...
@@ -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