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
d138e737
authored
Sep 28, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善功能
parent
87afbfb8
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
98 additions
and
17 deletions
app/Http/Controllers/Api/SupplierAccountApiController.php
app/Http/Controllers/SupplierAccountController.php
app/Http/Services/SupplierApplyService.php
app/Http/Validators/SupplierAccountValidator.php
config/perm.php
resources/views/script/SupplierAccountListScript.blade.php
resources/views/script/ViewAccountLogScript.blade.php
resources/views/web/SaveSupplierSubAccount.blade.php
resources/views/web/SupplierAccountList.blade.php
resources/views/web/UpdateSupplierAccount.blade.php
resources/views/web/ViewAccountLog.blade.php
app/Http/Controllers/Api/SupplierAccountApiController.php
View file @
d138e737
...
@@ -64,6 +64,8 @@ class SupplierAccountApiController extends Controller
...
@@ -64,6 +64,8 @@ class SupplierAccountApiController extends Controller
$model
=
new
SupplierAccountModel
();
$model
=
new
SupplierAccountModel
();
$id
=
$model
->
insertGetId
(
$data
);
$id
=
$model
->
insertGetId
(
$data
);
if
(
$id
)
{
if
(
$id
)
{
$logService
=
new
LogService
();
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'芯链账号操作'
,
'创建芯链账号。'
);
//还要插入一个redis
//还要插入一个redis
// $redis = new RedisModel();
// $redis = new RedisModel();
$redis
=
Redis
::
connection
(
'user'
);
$redis
=
Redis
::
connection
(
'user'
);
...
@@ -98,8 +100,12 @@ class SupplierAccountApiController extends Controller
...
@@ -98,8 +100,12 @@ class SupplierAccountApiController extends Controller
$data
[
'update_time'
]
=
time
();
$data
[
'update_time'
]
=
time
();
$data
[
'create_uid'
]
=
$request
->
user
->
userId
;
$data
[
'create_uid'
]
=
$request
->
user
->
userId
;
$model
=
new
SupplierAccountModel
();
$model
=
new
SupplierAccountModel
();
$oldAccount
=
$model
->
where
(
'id'
,
$data
[
'id'
])
->
first
()
->
toArray
();
$result
=
$model
->
where
(
'id'
,
$data
[
'id'
])
->
update
(
$data
);
$result
=
$model
->
where
(
'id'
,
$data
[
'id'
])
->
update
(
$data
);
if
(
$result
)
{
if
(
$result
)
{
$logService
=
new
LogService
();
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'芯链账号操作'
,
'修改芯链账号。原数据:供应商:'
.
$oldAccount
[
'supplier_code'
]
.
';联系人:'
.
$oldAccount
[
'contacts_name'
]
.
';邮箱:'
.
$oldAccount
[
'email'
]
.
';手机号:'
.
$oldAccount
[
'mobile'
]);
//还要插入一个redis
//还要插入一个redis
$redis
=
Redis
::
connection
(
'user'
);
$redis
=
Redis
::
connection
(
'user'
);
$redis
->
hset
(
'yunxin_api_user_mobile'
,
$data
[
'mobile'
],
$data
[
'id'
]);
$redis
->
hset
(
'yunxin_api_user_mobile'
,
$data
[
'mobile'
],
$data
[
'id'
]);
...
@@ -117,8 +123,11 @@ class SupplierAccountApiController extends Controller
...
@@ -117,8 +123,11 @@ class SupplierAccountApiController extends Controller
$model
=
new
SupplierAccountModel
();
$model
=
new
SupplierAccountModel
();
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$data
[
'a_status'
]
=
1
;
$data
[
'a_status'
]
=
1
;
$supplierId
=
$model
->
where
(
'id'
,
$id
)
->
value
(
'supplier_id'
);
$result
=
$model
->
where
(
'id'
,
$id
)
->
update
(
$data
);
$result
=
$model
->
where
(
'id'
,
$id
)
->
update
(
$data
);
if
(
$result
)
{
if
(
$result
)
{
$logService
=
new
LogService
();
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'芯链账号操作'
,
'启用芯链账号。'
);
$this
->
response
(
0
,
'启用成功'
);
$this
->
response
(
0
,
'启用成功'
);
}
}
$this
->
response
(
-
1
,
'启用失败'
,
$result
);
$this
->
response
(
-
1
,
'启用失败'
,
$result
);
...
@@ -131,8 +140,11 @@ class SupplierAccountApiController extends Controller
...
@@ -131,8 +140,11 @@ class SupplierAccountApiController extends Controller
$model
=
new
SupplierAccountModel
();
$model
=
new
SupplierAccountModel
();
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$data
[
'a_status'
]
=
0
;
$data
[
'a_status'
]
=
0
;
$supplierId
=
$model
->
where
(
'id'
,
$id
)
->
value
(
'supplier_id'
);
$result
=
$model
->
where
(
'id'
,
$id
)
->
update
(
$data
);
$result
=
$model
->
where
(
'id'
,
$id
)
->
update
(
$data
);
if
(
$result
)
{
if
(
$result
)
{
$logService
=
new
LogService
();
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'芯链账号操作'
,
'禁用芯链账号。'
);
$this
->
response
(
0
,
'禁用成功'
);
$this
->
response
(
0
,
'禁用成功'
);
}
}
$this
->
response
(
-
1
,
'禁用失败'
,
$result
);
$this
->
response
(
-
1
,
'禁用失败'
,
$result
);
...
@@ -179,7 +191,7 @@ class SupplierAccountApiController extends Controller
...
@@ -179,7 +191,7 @@ class SupplierAccountApiController extends Controller
];
];
$messages
=
[
$messages
=
[
'supplier_code.required'
=>
'请选择一个供应商'
,
'supplier_code.required'
=>
'请选择一个供应商'
,
'mobile.required'
=>
'
登录账
号不能为空'
,
'mobile.required'
=>
'
手机
号不能为空'
,
'mobile.regex'
=>
'账号格式必须为手机号'
,
'mobile.regex'
=>
'账号格式必须为手机号'
,
'email.email'
=>
'邮箱格式不对'
,
'email.email'
=>
'邮箱格式不对'
,
'password_raw.required'
=>
'账号密码不能为空'
,
'password_raw.required'
=>
'账号密码不能为空'
,
...
...
app/Http/Controllers/SupplierAccountController.php
View file @
d138e737
...
@@ -2,17 +2,18 @@
...
@@ -2,17 +2,18 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\Model\LogModel
;
use
Illuminate\Http\Request
;
use
App\Model\IntracodeModel
;
use
App\Http\Services\RoleService
;
use
App\Http\Services\RoleService
;
use
Illuminate\Support\Facades\DB
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\ViewCheckService
;
use
App\Http\Services\SupplierAccountService
;
use
App\Http\Services\SupplierAccountService
;
use
App\Http\Services\SupplierContactService
;
use
App\Http\Services\SupplierContactService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\SupplierSubAccountService
;
use
App\Http\Services\SupplierSubAccountService
;
use
App\Http\Services\ViewCheckService
;
use
App\Model\IntracodeModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
class
SupplierAccountController
extends
Controller
class
SupplierAccountController
extends
Controller
{
{
...
@@ -137,4 +138,21 @@ class SupplierAccountController extends Controller
...
@@ -137,4 +138,21 @@ class SupplierAccountController extends Controller
$this
->
data
[
'title'
]
=
'子账号编辑'
;
$this
->
data
[
'title'
]
=
'子账号编辑'
;
return
$this
->
view
(
'子账号编辑'
);
return
$this
->
view
(
'子账号编辑'
);
}
}
//查看日志
public
function
ViewAccountLog
(
$request
)
{
$accountId
=
$request
->
input
(
'id'
);
$this
->
data
[
'title'
]
=
'日志'
;
$model
=
new
LogModel
();
$supplierId
=
SupplierAccountModel
::
where
(
'id'
,
$accountId
)
->
value
(
'supplier_id'
);
$logList
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'action'
,
'芯链账号操作'
)
->
orderBy
(
'id'
,
'desc'
)
->
get
()
->
toArray
();
foreach
(
$logList
as
$key
=>
$value
)
{
$operateName
=
!
empty
(
explode
(
'。'
,
$value
[
'content'
]))
?
explode
(
'。'
,
$value
[
'content'
])[
0
]
:
''
;
$value
[
'operate_name'
]
=
$operateName
;
$logList
[
$key
]
=
$value
;
}
$this
->
data
[
'logList'
]
=
$logList
;
return
$this
->
view
(
'日志'
);
}
}
}
app/Http/Services/SupplierApplyService.php
View file @
d138e737
...
@@ -122,7 +122,7 @@ class SupplierApplyService
...
@@ -122,7 +122,7 @@ class SupplierApplyService
if
(
$status
==
SupplierApplyModel
::
STATUS_REJECT
)
{
if
(
$status
==
SupplierApplyModel
::
STATUS_REJECT
)
{
$message
=
"${apply['contact_name']} 先生/女生您好,您的“芯链入驻申请”已收到,审核结果为:不通过,原因为:${auditReason},如对审核结果有疑问,可联系您在猎芯的专属渠道经理(周强),联系电话:13427991931,联系邮箱:vendor@ichunt.com"
;
$message
=
"${apply['contact_name']} 先生/女生您好,您的“芯链入驻申请”已收到,审核结果为:不通过,原因为:${auditReason},如对审核结果有疑问,可联系您在猎芯的专属渠道经理(周强),联系电话:13427991931,联系邮箱:vendor@ichunt.com"
;
}
else
{
}
else
{
$message
=
"${apply['contact_name']} 先生/女生您好,您的“芯链入驻申请”已收到,审核结果为:通过,芯链登录网址:http://xinlian.ichunt.com,您的芯链
登录账
号:${apply['mobile']},初始密码:123456,请在登录芯链后修改密码,后续有任何疑问都可联系您在猎芯的专属渠道经理(周强),联系电话:13427991931,联系邮箱:vendor@ichunt.com;"
;
$message
=
"${apply['contact_name']} 先生/女生您好,您的“芯链入驻申请”已收到,审核结果为:通过,芯链登录网址:http://xinlian.ichunt.com,您的芯链
手机
号:${apply['mobile']},初始密码:123456,请在登录芯链后修改密码,后续有任何疑问都可联系您在猎芯的专属渠道经理(周强),联系电话:13427991931,联系邮箱:vendor@ichunt.com;"
;
}
}
$data
=
[];
$data
=
[];
$data
[
'data'
][
'title'
]
=
$message
;
$data
[
'data'
][
'title'
]
=
$message
;
...
...
app/Http/Validators/SupplierAccountValidator.php
View file @
d138e737
...
@@ -70,7 +70,7 @@ class SupplierAccountValidator
...
@@ -70,7 +70,7 @@ class SupplierAccountValidator
'supplier_code.required'
=>
'请选择一个供应商'
,
'supplier_code.required'
=>
'请选择一个供应商'
,
'contacts_name.required'
=>
'联系人不能为空'
,
'contacts_name.required'
=>
'联系人不能为空'
,
'a_type.required'
=>
'类型必须勾选为芯链商家'
,
'a_type.required'
=>
'类型必须勾选为芯链商家'
,
'mobile.required'
=>
'
登录账
号不能为空'
,
'mobile.required'
=>
'
手机
号不能为空'
,
'mobile.regex'
=>
'账号格式必须为手机号'
,
'mobile.regex'
=>
'账号格式必须为手机号'
,
'password_raw.required'
=>
'账号密码不能为空'
,
'password_raw.required'
=>
'账号密码不能为空'
,
'email.required'
=>
'邮箱不能为空'
,
'email.required'
=>
'邮箱不能为空'
,
...
...
config/perm.php
View file @
d138e737
...
@@ -15,6 +15,7 @@ return [
...
@@ -15,6 +15,7 @@ return [
'AddSupplierAttachment'
,
'AddSupplierAttachment'
,
'UpdateSupplierAttachment'
,
'UpdateSupplierAttachment'
,
'BatchUpdateSkuStatus'
,
'BatchUpdateSkuStatus'
,
'ViewAccountLog'
,
]
//不用验证权限的方法
]
//不用验证权限的方法
],
],
];
];
resources/views/script/SupplierAccountListScript.blade.php
View file @
d138e737
...
@@ -70,6 +70,7 @@
...
@@ -70,6 +70,7 @@
},
},
{
field
:
'create_time'
,
title
:
'创建时间'
,
align
:
'center'
,
width
:
150
},
{
field
:
'create_time'
,
title
:
'创建时间'
,
align
:
'center'
,
width
:
150
},
{
field
:
'update_time'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
150
},
{
field
:
'update_time'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
150
},
{
fixed
:
'right'
,
title
:
'操作'
,
toolbar
:
'#operate'
,
width
:
70
}
];
];
let
currentPage
=
0
;
let
currentPage
=
0
;
table
.
render
({
table
.
render
({
...
@@ -167,7 +168,19 @@
...
@@ -167,7 +168,19 @@
}
}
});
});
//日志
$
(
document
).
on
(
'click'
,
'.viewLog'
,
function
()
{
let
id
=
$
(
this
).
attr
(
'id'
);
layer
.
open
({
type
:
2
,
content
:
'/supplier_account/ViewAccountLog?view=iframe&id='
+
id
,
area
:
[
'1000px'
,
'800px'
],
title
:
'日志'
,
end
:
function
()
{
// supplierStatistics();
}
});
});
form
.
on
(
'submit(load)'
,
function
(
data
)
{
form
.
on
(
'submit(load)'
,
function
(
data
)
{
whereCondition
=
$
.
extend
(
false
,
initCondition
,
data
.
field
);
whereCondition
=
$
.
extend
(
false
,
initCondition
,
data
.
field
);
//执行重载
//执行重载
...
...
resources/views/script/ViewAccountLogScript.blade.php
0 → 100644
View file @
d138e737
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'layer'
,
'Split'
,
'admin'
,
'xmSelect'
],
function
()
{
let
$
=
layui
.
jquery
;
let
Split
=
layui
.
Split
;
// 水平分割,需要分割的元素(id)、默认大小(百分比)、最小值(单位px)
let
table
=
layui
.
table
;
let
form
=
layui
.
form
;
let
admin
=
layui
.
admin
;
let
xmSelect
=
layui
.
xmSelect
;
let
initCondition
=
{
source_type
:
'all'
};
let
whereCondition
=
initCondition
;
let
type
=
'all'
;
});
</script>
resources/views/web/SaveSupplierSubAccount.blade.php
View file @
d138e737
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
账号 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
账号 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"mobile"
id=
"mobile"
<input
type=
"text"
name=
"mobile"
id=
"mobile"
placeholder=
"请输入
登录账
号"
class=
"layui-input"
placeholder=
"请输入
手机
号"
class=
"layui-input"
value=
"{{$account['mobile'] or ''}}"
>
value=
"{{$account['mobile'] or ''}}"
>
</div>
</div>
</div>
</div>
...
...
resources/views/web/SupplierAccountList.blade.php
View file @
d138e737
...
@@ -59,10 +59,9 @@
...
@@ -59,10 +59,9 @@
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"disable_supplier_account"
>
禁用
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"disable_supplier_account"
>
禁用
</button>
</div>
</div>
@endif
@endif
<table
class=
"layui-table"
id=
"supplierAccountList"
lay-filter=
"supplierAccountList"
></table>
<table
class=
"layui-table"
id=
"supplierAccountList"
lay-filter=
"supplierAccountList"
></table>
</div>
</div>
<script>
<script
type=
"text/html"
id=
"operate"
>
<
button
class
=
"layui-btn layui-btn-xs viewLog"
id
=
"@{{d.id}}"
lay
-
event
=
"viewLog"
>
日志
<
/button
>
</script>
</script>
resources/views/web/UpdateSupplierAccount.blade.php
View file @
d138e737
...
@@ -35,9 +35,9 @@
...
@@ -35,9 +35,9 @@
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
登录账
号 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
手机
号 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"mobile"
id=
"mobile"
placeholder=
"请输入
登录账
号"
class=
"layui-input"
value=
"{{$account['mobile'] or ''}}"
>
<input
type=
"text"
name=
"mobile"
id=
"mobile"
placeholder=
"请输入
手机
号"
class=
"layui-input"
value=
"{{$account['mobile'] or ''}}"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
...
...
resources/views/web/ViewAccountLog.blade.php
0 → 100644
View file @
d138e737
<div
class=
"layui-collapse"
>
<table
class=
"layui-table"
id=
"supplierAccountLogList"
lay-filter=
"supplierAccountLogList"
>
<thead>
<tr>
<th
style=
"width: 120px"
>
动作
</th>
<th
style=
"width: 150px"
>
操作时间
</th>
<th
style=
"width: 100px"
>
操作人
</th>
<th>
操作内容
</th>
</tr>
</thead>
<tbody>
@foreach($logList as $log)
<tr>
<td>
{{$log['operate_name']}}
</td>
<td>
{{$log['add_time']?date('Y-m-d H:i:s',$log['add_time']):''}}
</td>
<td>
{{$log['admin_name']}}
</td>
<td>
{{$log['content']}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
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