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
ce33544a
authored
Jan 03, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
数据脚本完善
parent
94953e01
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
app/Http/Services/DataService.php
app/Http/routes.php
app/Providers/AppServiceProvider.php
app/Http/Services/DataService.php
View file @
ce33544a
This diff is collapsed.
Click to expand it.
app/Http/routes.php
View file @
ce33544a
...
...
@@ -96,7 +96,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
DataService
::
initHistoricalSupplierData
();
DataService
::
initHistoricalSupplierData
(
false
);
// DataService::initSupplierReceiptNationId();
// SupplierAccountService::initYunxinAccountName();
// DataService::syncSupplierToErp();
...
...
app/Providers/AppServiceProvider.php
View file @
ce33544a
...
...
@@ -4,6 +4,8 @@ namespace App\Providers;
use
Illuminate\Support\Facades\View
;
use
Illuminate\Support\ServiceProvider
;
use
Symfony\Component\VarDumper\Cloner\VarCloner
;
use
Symfony\Component\VarDumper\Dumper\HtmlDumper
;
class
AppServiceProvider
extends
ServiceProvider
{
...
...
@@ -14,8 +16,33 @@ class AppServiceProvider extends ServiceProvider
*/
public
function
boot
()
{
//共享全局模板变量
// 只在本地环境生效
if
(
$this
->
app
->
environment
(
'local'
))
{
// 自定义一个新的 Handler
\Symfony\Component\VarDumper\VarDumper
::
setHandler
(
function
(
$var
)
{
$cloner
=
new
VarCloner
();
$dumper
=
new
HtmlDumper
();
// 关键:自定义白色背景的样式(覆盖默认黑色)
$dumper
->
setStyles
([
'default'
=>
'background-color:#fff; color:#222; line-height:1.5; font-weight: normal; font:12px Menlo, Monaco, Consolas, "Courier New", monospace; padding: 15px; border:1px solid #ddd; border-radius:4px; margin:10px 0;'
,
'num'
=>
'color:#a71d5d;'
,
'const'
=>
'color:#795da3;'
,
'str'
=>
'color:#df5000;'
,
'note'
=>
'color:#a71d5d;'
,
'ref'
=>
'color:#a0a0a0;'
,
'public'
=>
'color:#795da3;'
,
'protected'
=>
'color:#795da3;'
,
'private'
=>
'color:#795da3;'
,
'meta'
=>
'color:#b729d9;'
,
'key'
=>
'color:#df5000;'
,
'index'
=>
'color:#a71d5d;'
,
]);
// 正确传参:先 cloner 克隆,再 dumper 输出
$dumper
->
dump
(
$cloner
->
cloneVar
(
$var
));
});
}
}
/**
...
...
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