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
46959db6
authored
Apr 26, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
渠道开发优化选择
parent
0eeccb97
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
19 deletions
app/Http/Controllers/SupplierController.php
app/Http/Services/AdminUserService.php
app/Http/Services/SupplierService.php
app/Http/Transformers/SupplierTransformer.php
app/Http/Validators/SupplierValidator.php
app/Model/IntracodeModel.php
resources/views/script/SupplierDetailScript.blade.php
resources/views/script/UpdateSupplierScript.blade.php
app/Http/Controllers/SupplierController.php
View file @
46959db6
...
...
@@ -183,10 +183,7 @@ class SupplierController extends Controller
$supplier
=
$transformer
->
transformInfo
(
$supplier
);
$this
->
data
[
'supplier'
]
=
$supplier
;
$intracodeModel
=
new
IntracodeModel
();
$adminUserService
=
new
AdminUserService
();
// $userCodes = $adminUserService->getPurchaseUserCodes();
$this
->
data
[
'userCodes'
]
=
$intracodeModel
->
getSampleEncode
();
// $this->data['userCodes'] =$userCodes;
$this
->
data
[
'userCodes'
]
=
$intracodeModel
->
getPurchaseUserCodes
();
$logModel
=
new
LogModel
();
$this
->
data
[
'logs'
]
=
$logModel
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'action'
,
'分配渠道开发员'
)
->
orderBy
(
'id'
,
'desc'
)
...
...
app/Http/Services/AdminUserService.php
View file @
46959db6
...
...
@@ -63,13 +63,5 @@ class AdminUserService
return
$users
;
}
public
function
getPurchaseUserCodes
()
{
$users
=
$this
->
getPurchaseUsers
();
$userCodes
=
[];
foreach
(
$users
as
$user
)
{
$userCodes
[
$user
[
'code_id'
]]
=
$user
[
'name'
];
}
return
$userCodes
;
}
}
\ No newline at end of file
app/Http/Services/SupplierService.php
View file @
46959db6
...
...
@@ -122,8 +122,6 @@ class SupplierService
$channel
[
'update_time'
]
=
time
();
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
update
(
$channel
);
$this
->
saveSupplierCode
(
$supplierId
);
//不能直接插到数据库,要存到一个临时的地方,审核通过才写到数据库
$redis
=
$redis
->
hset
(
"supplier_audit_list"
,
$supplierId
);
//插入系数到redis
$supplierAddressService
=
new
SupplierAddressService
();
$supplierAddressService
->
saveAddress
(
$address
);
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
46959db6
...
...
@@ -118,7 +118,7 @@ class SupplierTransformer
$log
=
$logModel
->
where
(
'supplier_id'
,
$supplier
[
'supplier_id'
])
->
where
(
'type'
,
LogModel
::
UPDATE_OPERATE
)
->
orderBy
(
'id'
,
'desc'
)
->
first
();
$supplier
[
'last_update_name'
]
=
$log
[
'admin_name'
]
?:
'无'
;
$supplier
[
'last_update_time'
]
=
$supplier
[
'last_update_time'
]
?
date
(
'Y-m-d H:i:s'
,
$log
[
'add_time'
])
:
'无'
;
$supplier
[
'last_update_time'
]
=
!
empty
(
$supplier
[
'last_update_time'
])
?
date
(
'Y-m-d H:i:s'
,
$log
[
'add_time'
])
:
'无'
;
return
$supplier
;
}
...
...
app/Http/Validators/SupplierValidator.php
View file @
46959db6
...
...
@@ -21,7 +21,7 @@ class SupplierValidator
'legal_representative'
=>
'required'
,
'register_company_name'
=>
'required'
,
'stockup_type'
=>
'required'
,
'supplier_group'
=>
'required'
,
//
'supplier_group' => 'required',
'region'
=>
'required'
,
'cn_delivery_time'
=>
'regex:/^\d+\-\d$/'
,
'us_delivery_time'
=>
'regex:/^\d+\-\d$/'
,
...
...
app/Model/IntracodeModel.php
View file @
46959db6
...
...
@@ -2,6 +2,7 @@
namespace
App\Model
;
use
App\Http\Services\AdminUserService
;
use
Illuminate\Database\Eloquent\Model
;
class
IntracodeModel
extends
Model
...
...
@@ -73,4 +74,26 @@ class IntracodeModel extends Model
}
return
$code
;
}
//获取渠道开发那边的人员(还是会汇总所有的内部编码的,只是把运营他们那边的人员优先级提高一些)
public
function
getPurchaseUserCodes
()
{
$adminService
=
new
AdminUserService
();
$users
=
$adminService
->
getPurchaseUsers
();
$codeIds
=
array_column
(
$users
,
'code_id'
);
$codes
=
$this
->
getSampleEncode
();
$userCodes
=
[];
foreach
(
$users
as
$user
)
{
$userCodes
[
$user
[
'code_id'
]]
=
$user
[
'name'
];
}
$temp
=
[];
foreach
(
$codes
as
$code
=>
$name
)
{
if
(
in_array
(
$code
,
$codeIds
))
{
unset
(
$codes
[
$code
]);
$temp
[
$code
]
=
$name
;
}
}
$userCodes
=
$temp
+
$codes
;
return
$userCodes
;
}
}
resources/views/script/SupplierDetailScript.blade.php
View file @
46959db6
...
...
@@ -20,7 +20,7 @@
{{
--
admin
.
putTempData
(
'{{$supplier['
supplier_code
']}}'
,
{{
$supplier
[
'update_time'
]}});
--
}}
{{
--
}
--
}}
index
.
setTabTitle
(
'供应商详情 - {{$supplier['
supplier_code
'] or ''}}'
);
{{
--
index
.
setTabTitle
(
'供应商详情 - {{$supplier['
supplier_code
'] or ''}}'
);
--
}}
function
openLogView
()
{
// 打开右侧面板
...
...
resources/views/script/UpdateSupplierScript.blade.php
View file @
46959db6
...
...
@@ -12,7 +12,7 @@
layer
.
load
(
1
);
});
index
.
setTabTitle
(
'供应商修改 - {{$supplier['
supplier_code
'] or ''}}'
);
{{
--
index
.
setTabTitle
(
'供应商修改 - {{$supplier['
supplier_code
'] or ''}}'
);
--
}}
form
.
on
(
'submit(updateSupplier)'
,
function
(
data
)
{
let
confirmMessage
=
''
;
...
...
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