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
c896bae0
authored
Sep 14, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
供应商入驻字段
parent
8239706f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
4 deletions
app/Http/Controllers/Api/ChainApiController.php
app/Http/Services/SupplierStatisticsService.php
app/Http/Transformers/ChainTransformer.php
config/field.php
resources/views/script/ChainListScript.blade.php
resources/views/web/ChainList.blade.php
app/Http/Controllers/Api/ChainApiController.php
View file @
c896bae0
...
@@ -8,6 +8,7 @@ use App\Http\Services\ChainService;
...
@@ -8,6 +8,7 @@ use App\Http\Services\ChainService;
use
App\Http\Services\SupplierExaminationService
;
use
App\Http\Services\SupplierExaminationService
;
use
App\Http\Transformers\SupplierLogTransformer
;
use
App\Http\Transformers\SupplierLogTransformer
;
use
App\Http\Validators\SupplierExaminationValidator
;
use
App\Http\Validators\SupplierExaminationValidator
;
use
App\Model\ChainModel
;
use
App\Model\LogModel
;
use
App\Model\LogModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierApplyModel
;
use
App\Model\SupplierApplyModel
;
...
@@ -30,4 +31,12 @@ class ChainApiController extends Controller
...
@@ -30,4 +31,12 @@ class ChainApiController extends Controller
$list
=
$service
->
getChainList
(
$request
->
all
());
$list
=
$service
->
getChainList
(
$request
->
all
());
$this
->
response
(
0
,
'ok'
,
$list
[
'data'
],
$list
[
'total'
]);
$this
->
response
(
0
,
'ok'
,
$list
[
'data'
],
$list
[
'total'
]);
}
}
//获取芯链账号
public
function
GetChain
(
$request
)
{
$chainId
=
$request
->
input
(
'chain_id'
);
$chain
=
ChainModel
::
where
(
'chain_id'
,
$chainId
)
->
first
()
->
toArray
();
$this
->
response
(
0
,
'ok'
,
$chain
);
}
}
}
app/Http/Services/SupplierStatisticsService.php
View file @
c896bae0
...
@@ -115,7 +115,7 @@ class SupplierStatisticsService
...
@@ -115,7 +115,7 @@ class SupplierStatisticsService
return
$value
;
return
$value
;
},
$result
);
},
$result
);
$redis
->
set
(
$statisticsKey
,
json_encode
(
$result
));
$redis
->
set
(
$statisticsKey
,
json_encode
(
$result
));
$redis
->
expire
(
$statisticsKey
,
60
0
);
$redis
->
expire
(
$statisticsKey
,
60
);
return
$result
;
return
$result
;
}
}
...
...
app/Http/Transformers/ChainTransformer.php
View file @
c896bae0
...
@@ -17,10 +17,26 @@ class ChainTransformer
...
@@ -17,10 +17,26 @@ class ChainTransformer
$item
[
'create_time'
]
=
$item
[
'create_time'
]
?
date
(
'Y-m-d H:i:s'
,
$item
[
'create_time'
])
:
''
;
$item
[
'create_time'
]
=
$item
[
'create_time'
]
?
date
(
'Y-m-d H:i:s'
,
$item
[
'create_time'
])
:
''
;
$item
[
'supplier_type_name'
]
=
array_get
(
config
(
'field.ChainSupplierType'
),
$item
[
'supplier_type'
],
'无'
);
$item
[
'supplier_type_name'
]
=
array_get
(
config
(
'field.ChainSupplierType'
),
$item
[
'supplier_type'
],
'无'
);
$item
[
'data_type_name'
]
=
array_get
(
config
(
'field.ChainDataType'
),
$item
[
'data_type'
],
'无'
);
$item
[
'data_type_name'
]
=
array_get
(
config
(
'field.ChainDataType'
),
$item
[
'data_type'
],
'无'
);
$item
[
'company_nature'
]
=
array_get
(
config
(
'field.ChainCompanyNature'
),
$item
[
'company_nature'
],
'无'
);
$item
[
'region'
]
=
array_get
(
config
(
'field.ChainRegion'
),
$item
[
'region'
],
'无'
);
if
(
!
empty
(
$item
[
'mobile'
]))
{
$item
[
'mobile'
]
=
substr
(
$item
[
'mobile'
],
0
,
3
)
.
'****'
.
substr
(
$item
[
'mobile'
],
7
);
}
if
(
!
empty
(
$item
[
'email'
]))
{
$emailTemp
=
explode
(
'@'
,
$item
[
'email'
])[
0
];
$replace
=
str_pad
(
'*'
,
strlen
(
$emailTemp
),
'*'
);
$emailTemp
=
str_replace
(
$emailTemp
,
$replace
,
$emailTemp
);
if
(
count
(
explode
(
'@'
,
$item
[
'email'
]))
>
1
)
{
$item
[
'email'
]
=
$emailTemp
.
'@'
.
explode
(
'@'
,
$item
[
'email'
])[
1
];
}
else
{
$item
[
'email'
]
=
$emailTemp
;
}
}
}
}
unset
(
$item
);
unset
(
$item
);
return
$list
;
return
$list
;
}
}
}
}
\ No newline at end of file
config/field.php
View file @
c896bae0
...
@@ -290,4 +290,19 @@ return [
...
@@ -290,4 +290,19 @@ return [
2
=>
'联营供应商'
,
2
=>
'联营供应商'
,
3
=>
'国产推荐'
3
=>
'国产推荐'
],
],
'ChainCompanyNature'
=>
[
7
=>
'原厂'
,
1
=>
'代理商'
,
2
=>
'现货商'
,
3
=>
'其它'
,
],
'ChainRegion'
=>
[
1
=>
'欧美'
,
2
=>
'大陆'
,
3
=>
'日韩'
,
4
=>
'港台'
,
5
=>
'其它'
,
]
];
];
resources/views/script/ChainListScript.blade.php
View file @
c896bae0
This diff is collapsed.
Click to expand it.
resources/views/web/ChainList.blade.php
View file @
c896bae0
...
@@ -54,4 +54,3 @@
...
@@ -54,4 +54,3 @@
</div>
</div>
<table
class=
"layui-table"
id=
"chainList"
lay-filter=
"chainList"
></table>
<table
class=
"layui-table"
id=
"chainList"
lay-filter=
"chainList"
></table>
</div>
</div>
@include('script.ChainListScript')
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