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
c93a1f4c
authored
Jun 01, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
修复冲突
parents
5726a218
3f2dce8a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
21 deletions
app/Http/Controllers/Api/SkuApiController.php
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Services/DataService.php
app/Http/routes.php
app/Providers/EventServiceProvider.php
resources/views/web/SupplierDetail.blade.php
app/Http/Controllers/Api/SkuApiController.php
View file @
c93a1f4c
...
...
@@ -196,9 +196,9 @@ class SkuApiController extends Controller
if
(
!
$setType
)
{
$this
->
response
(
-
1
,
'请选择设置类型'
);
}
if
(
$setType
==
1
&&
empty
(
$supplierGroup
))
{
$this
->
response
(
-
1
,
'批量设置必须选择对应的供应商性质'
);
}
//
if ($setType == 1 && empty($supplierGroup)) {
//
$this->response(-1, '批量设置必须选择对应的供应商性质');
//
}
if
(
$setType
==
2
&&
empty
(
$supplierCode
))
{
$this
->
response
(
-
2
,
'单个设置必须选择对应的供应商编码'
);
}
...
...
app/Http/Controllers/Filter/SupplierFilter.php
View file @
c93a1f4c
...
...
@@ -365,9 +365,11 @@ class SupplierFilter
$query
->
where
(
'stockup_type'
,
'NOT LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
'>'
,
0
);
break
;
case
"not_yunxin_expired"
:
case
"not_yunxin_and_has_no_sku"
:
$query
->
where
(
'stockup_type'
,
'NOT LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
0
);
break
;
case
"not_yunxin_and_has_no_sku"
:
$query
->
where
(
'stockup_type'
,
'NOT LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
0
)
->
where
(
'uploaded_sku'
,
1
);
break
;
case
"yunxin"
:
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
);
break
;
...
...
@@ -375,9 +377,11 @@ class SupplierFilter
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
'>'
,
0
);
break
;
case
"yunxin_expired"
:
case
"yunxin_and_has_no_sku"
:
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
0
);
break
;
case
"yunxin_and_has_no_sku"
:
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
)
->
where
(
'sku_num'
,
0
)
->
where
(
'uploaded_sku'
,
1
);
break
;
case
"yunxin_expired_at_days"
:
$query
->
where
(
'stockup_type'
,
'LIKE'
,
'%5%'
)
->
where
(
'sku_expired_in_days'
,
'!='
,
0
);
break
;
...
...
app/Http/Services/DataService.php
View file @
c93a1f4c
...
...
@@ -1244,12 +1244,19 @@ class DataService
$dataManagerSupplierCodeList
=
DataManageModel
::
where
(
'is_type'
,
0
)
->
where
(
'canal'
,
'!='
,
''
)
->
pluck
(
'canal'
)
->
toArray
();
//sku上架总数含api接口
$skuNum1
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'supplier_group'
,
'!='
,
4
)
->
whereNotIn
(
'supplier_name'
,
config
(
'field.SkipChangeSupplierTypeNames'
))
->
sum
(
'sku_num'
);
//sku上架总数,不含api接口
$skuNum2
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'supplier_group'
,
'!='
,
4
)
->
whereNotIn
(
'supplier_name'
,
config
(
'field.SkipChangeSupplierTypeNames'
))
->
whereNotIn
(
'supplier_code'
,
$dataManagerSupplierCodeList
)
->
sum
(
'sku_num'
);
//有上架sku的供应商
$supplierCount
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'supplier_group'
,
'!='
,
4
)
->
whereNotIn
(
'supplier_name'
,
config
(
'field.SkipChangeSupplierTypeNames'
))
->
where
(
'sku_num'
,
'>'
,
0
)
->
count
();
$yunxinSupplierCodes
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'stockup_type'
,
'like'
,
'%5%'
)
->
where
(
'sku_num'
,
'>'
,
0
)
->
pluck
(
'supplier_code'
);
//找出哪些是云芯上传的
$yunxinUploadSupplierCodes
=
SkuUploadLogModel
::
whereIn
(
'supplier_code'
,
$yunxinSupplierCodes
)
->
where
(
'source'
,
2
)
->
pluck
(
'supplier_code'
)
->
unique
()
->
toArray
();
$skuNumYunxin
=
SupplierChannelModel
::
whereIn
(
'supplier_code'
,
$yunxinUploadSupplierCodes
)
->
sum
(
'sku_num'
);
dump
(
"上架供应商数(不含代购,原厂):"
.
$supplierCount
);
dump
(
"上架云芯供应商数:"
.
count
(
$yunxinUploadSupplierCodes
));
dump
(
"SKU 上架总条数(含API接口):"
.
$skuNum1
);
dump
(
"SKU上架总条数(只含云芯):"
.
$skuNumYunxin
);
dump
(
"SKU 上架条数(不含API接口):"
.
$skuNum2
);
}
...
...
app/Http/routes.php
View file @
c93a1f4c
...
...
@@ -13,9 +13,7 @@
use
App\Http\Services\DepartmentService
;
use
App\Http\Services\MessageService
;
use
App\Http\Services\SkuService
;
use
App\Model\SupplierChannelModel
;
Route
::
group
([
'middleware'
=>
[
'web'
,
'menu'
]],
function
()
{
Route
::
get
(
'/'
,
'WebController@Entrance'
);
...
...
@@ -69,13 +67,12 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
(
new
\App\Http\Services\DataService
())
->
statisticsSkuNumber
();
// (new \App\Http\Services\DataService())->initialMainBrandsLimit();
// (new \App\Http\Services\DataService())->initialMainBrandsToSkuRuler();
// \App\Model\SupplierChannelModel::where('supplier_name', '深圳市金开盛电子有限公司')->update([
// 'status' => 2,
// 'update_time' => time(),
// ]);
\App\Model\SupplierChannelModel
::
where
(
'supplier_code'
,
'L0010173'
)
->
update
([
'stockup_type'
=>
''
,
]);
// \App\Model\SupplierChannelModel::where('supplier_name', '厦门市三安集成电路有限公司')->update([
// 'status' => 2,
// 'update_time' => time(),
...
...
app/Providers/EventServiceProvider.php
View file @
c93a1f4c
...
...
@@ -3,7 +3,10 @@
namespace
App\Providers
;
use
Illuminate\Contracts\Events\Dispatcher
as
DispatcherContract
;
use
Illuminate\Database\Events\QueryExecuted
;
use
Illuminate\Foundation\Support\Providers\EventServiceProvider
as
ServiceProvider
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Log
;
class
EventServiceProvider
extends
ServiceProvider
{
...
...
@@ -28,6 +31,35 @@ class EventServiceProvider extends ServiceProvider
{
parent
::
boot
(
$events
);
// //监听laravel框架执行的sql语句 并记录到log日志文件中
// DB::listen(function(QueryExecuted $event){
//
// $sql = $event->sql; //执行的sql语句
// $bindings = $event->bindings; //sql语句对应绑定的sql值
// $time = $event->time; //sql执行的时间
//
// $bindings = array_map(function($binding){
// if(is_string($binding))
// {
// return "'$binding'"; //如果$binding是字符串类型 则要将$binding的左右两边拼接上'' 即 字符串=》 '字符串'
// }
// else if($binding instanceof \DateTime)
// {
// return $binding->format("'Y-m-d H:i:s'"); //如果$binding是一个DateTime对象 则格式化时间 并在左右俩边拼接上''
// }
// else
// {
// return $binding; //直接返回$binding原本的值
// }
// }, $bindings);
//
// $sql = str_replace('?', '%s', $sql); //将sql语句中的?换成%s
//// $sql = sprintf($sql, ...$bindings); //将$bindings数组中的每一个元素替换掉$sql中的%s的位置
//
// Log::info("sql_log", ["sql" => $sql, "execute_time" => $time]); //将最终生成的sql语句写入到log日志文件中
//
// });
//
}
}
resources/views/web/SupplierDetail.blade.php
View file @
c93a1f4c
...
...
@@ -113,7 +113,7 @@
<li
@
if
(!
checkPerm
('
UpdateSkuRuler
'))
style=
"display: none"
@
endif
id=
"ruler"
>
SKU概况
</li>
<li
@
if
(!
checkPerm
('
ViewSupplierExamination
'))
style=
"display: none"
@
endif
@
if
(
request
()
-
>
get('tab')=='examination')
class="layui-this"
class="layui-this"
@endif
id="examination">检测记录
</li>
...
...
@@ -162,7 +162,8 @@
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md2"
>
<span
class=
"required_field"
>
*
</span>
法人代表 :{{$supplier['legal_representative']}}
<span
class=
"required_field"
>
*
</span>
法人代表
:{{$supplier['legal_representative']}}
</div>
<div
class=
"layui-col-md3"
>
法人身份证 :
...
...
@@ -177,13 +178,15 @@
</div>
<div
class=
"layui-row"
>
<span
class=
"required_field"
>
*
</span>
主营品牌 :{{$supplier['main_brand_names']}}
<div
style=
"margin-left: 50px"
>
主营品牌数量 :{{$supplier['main_brands_limit']}}
<div
style=
""
>
主营品牌数量
:{{$supplier['main_brands_limit']!=-1?$supplier['main_brands_limit']:'无限制'}}
</div>
</div>
@if($supplier['supplier_group'] == \App\Model\SupplierChannelModel::SUPPLIER_GROUP_MIX)
<div
class=
"layui-row"
>
<span
class=
"required_field"
>
*
</span>
代理品牌 :{{!empty($supplier['agency_brand_names'])?$supplier['agency_brand_names']:''}}
<span
class=
"required_field"
>
*
</span>
代理品牌
:{{!empty($supplier['agency_brand_names'])?$supplier['agency_brand_names']:''}}
</div>
@endif
<div
class=
"layui-row"
>
...
...
@@ -337,7 +340,7 @@
<div
class=
"layui-tab-item"
>
<div
@
if
(!
checkPerm
('
ViewRuler
'))
style=
"display: none"
style=
"display: none"
@
endif
>
<div
class=
"layui-row"
style=
"padding-bottom: 10px"
>
...
...
@@ -373,7 +376,8 @@
</blockquote>
<div
class=
"layui-row"
style=
"margin-bottom: 10px"
>
@if($supplier['cn_delivery_time'])
大陆交期 : {{$supplier['cn_delivery_time'] .' '. $supplier['cn_delivery_time_period']}} ,
大陆交期 : {{$supplier['cn_delivery_time'] .' '. $supplier['cn_delivery_time_period']}}
,
@else
大陆交期未设置
@endif
...
...
@@ -418,7 +422,7 @@
<input
type=
"checkbox"
name=
"sku_upload_ruler[{{$key}}]"
lay-skin=
"primary"
@
if
($
flag
)
checked
checked
@
endif
disabled
title=
"{{array_get(config('fixed.SkuUploadRuler'),$key)}}"
>
...
...
@@ -465,7 +469,7 @@
class=
"audit_ruler_item"
disabled
@
if
($
flag
)
checked
checked
@
endif
title=
"{{array_get(config('fixed.SkuAuditRuler.name_map'),$key)}}"
>
@endif
...
...
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