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
02ba806d
authored
Aug 04, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复脚本
parent
51cdff1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
31 deletions
app/Http/Services/DataService.php
app/Http/routes.php
app/Http/Services/DataService.php
View file @
02ba806d
...
...
@@ -38,11 +38,11 @@ class DataService
{
$tagList
=
[
// 1 => '临时供应商',
// 2 => '优质供应商',
// 3 => '客户指定供应商',
// 4 => '开票不及时',
// 5 => '跳票',
// 1 => '临时供应商',
// 2 => '优质供应商',
// 3 => '客户指定供应商',
// 4 => '开票不及时',
// 5 => '跳票',
'战略供应商'
,
];
...
...
@@ -98,8 +98,10 @@ class DataService
$users
=
$intraCodeModel
->
getSampleName
(
true
);
foreach
(
$suppliers
as
$supplier
)
{
$mainBrands
=
(
new
SupplierTransformer
())
->
getMainBrandNames
(
$supplier
[
'main_brands'
]);
$attachmentsField
=
SupplierAttachmentsModel
::
where
(
'supplier_id'
,
$supplier
[
'supplier_id'
])
->
pluck
(
'field_name'
)
->
toArray
();
$attachmentsField
=
SupplierAttachmentsModel
::
where
(
'supplier_id'
,
$supplier
[
'supplier_id'
]
)
->
pluck
(
'field_name'
)
->
toArray
();
$hasPinzhi
=
$hasHezuo
=
'否'
;
if
(
in_array
(
'quality_assurance_agreement'
,
$attachmentsField
))
{
$hasPinzhi
=
'是'
;
...
...
@@ -126,8 +128,10 @@ class DataService
->
groupBy
(
'purchase_uid'
)
->
orderBy
(
'purchase_order_num'
,
'DESC'
)
->
first
();
if
(
!
empty
(
$mostPurchaseOrderUser
))
{
$mostPurchaseOrderUser
=
$mostPurchaseOrderUser
->
toArray
();
$codeId
=
IntracodeModel
::
where
(
'admin_id'
,
$mostPurchaseOrderUser
[
'purchase_uid'
])
->
value
(
'code_id'
);
$codeId
=
IntracodeModel
::
where
(
'admin_id'
,
$mostPurchaseOrderUser
[
'purchase_uid'
]
)
->
value
(
'code_id'
);
if
(
$codeId
)
{
$skuUserNameRaw
=
array_get
(
$users
,
$codeId
);
$skuUserName
=
$skuUserNameRaw
.
'(采购系统下单最多)'
;
...
...
@@ -444,7 +448,6 @@ class DataService
});
}
})
->
export
(
'xlsx'
);
}
function
syncDaigouSuppliersToErp
()
...
...
@@ -490,9 +493,7 @@ class DataService
$excel
->
sheet
(
'sheet1'
,
function
(
$sheet
)
use
(
$excelData
)
{
$sheet
->
fromArray
(
$excelData
);
});
})
->
save
(
'xlsx'
);
}
function
exportSupplier
()
...
...
@@ -567,7 +568,6 @@ class DataService
$suppliers
=
array_merge
(
$suppliers
,
$supplierList
);
}
}
}
$idColumn
=
array_column
(
$suppliers
,
'supplier_name'
);
...
...
@@ -594,9 +594,7 @@ class DataService
$excel
->
sheet
(
'sheet1'
,
function
(
$sheet
)
use
(
$excelData
)
{
$sheet
->
fromArray
(
$excelData
);
});
})
->
save
(
'xlsx'
);
}
public
static
function
checkSupplierBandAccount
()
...
...
@@ -615,15 +613,11 @@ class DataService
'account_no'
=>
$accountNo
,
]);
}
}
}
}
public
static
function
exportInvalidSupplierName
()
{
}
public
static
function
exportInvalidSupplierName
()
{}
public
static
function
repairAccount
()
{
...
...
@@ -669,7 +663,6 @@ class DataService
$excel
->
sheet
(
'sheet1'
,
function
(
$sheet
)
use
(
$excelData
)
{
$sheet
->
fromArray
(
$excelData
);
});
})
->
export
(
'csv'
);
}
...
...
@@ -710,7 +703,6 @@ class DataService
}
});
});
}
public
static
function
initSignCom
()
...
...
@@ -722,20 +714,19 @@ class DataService
$sheet
->
fromArray
(
$sheet
->
toArray
());
});
});
}
public
static
function
deleteSupplierContract
()
{
SupplierContractModel
::
where
(
'id'
,
10
)
->
delete
();
SupplierContractModel
::
where
(
'id'
,
10
)
->
delete
();
}
public
static
function
repairSupplierChannel
()
{
SupplierChannelModel
::
where
(
'supplier_id'
,
272
)
->
update
([
'is_entity'
=>
-
1
,
'status'
=>
2
,
]);
SupplierChannelModel
::
where
(
'supplier_id'
,
272
)
->
update
([
'is_entity'
=>
-
1
,
'status'
=>
2
,
]);
}
public
static
function
batchSetPurchaseType
()
...
...
@@ -782,11 +773,36 @@ class DataService
continue
;
}
if
(
$supplier
)
{
SupplierChannelModel
::
where
(
'supplier_name'
,
$supplierName
)
->
update
([
SupplierChannelModel
::
where
(
'supplier_name'
,
$supplierName
)
->
update
([
'purchase_type'
=>
2
,
]);
]);
}
}
}
public
static
function
repairSupplierCpTime
()
{
$isUpdate
=
request
()
->
get
(
'is_update'
,
false
);
ini_set
(
'memory_limit'
,
'2048M'
);
//倒序供应商
$suppliers
=
SupplierChannelModel
::
orderBy
(
'supplier_id'
,
'desc'
)
->
get
()
->
toArray
();
$redis
=
new
RedisModel
();
foreach
(
$suppliers
as
$supplier
)
{
//检测cp_time是否为空
$ruler
=
$redis
->
hget
(
'supplier_sku_upload_ruler_v2'
,
$supplier
[
'supplier_id'
]);
if
(
empty
(
$ruler
))
{
$cpTimeDay
=
$supplier
[
'cp_time_day'
];
$futuresCpTimeDay
=
$supplier
[
'futures_cp_time_day'
];
$data
=
[
'upload_validity_period'
=>
$cpTimeDay
,
'upload_futures_goods_validity_period'
=>
$futuresCpTimeDay
,
];
if
(
$isUpdate
)
{
$redis
->
hset
(
'supplier_sku_upload_ruler_v2'
,
$supplier
[
'supplier_id'
],
json_encode
(
$data
));
}
\dump
(
$supplier
[
'supplier_id'
],
$data
);
}
continue
;
}
}
}
app/Http/routes.php
View file @
02ba806d
...
...
@@ -90,5 +90,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
DataService
::
batchSetPurchaseTyp
e
();
DataService
::
repairSupplierCpTim
e
();
});
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