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
b8164862
authored
May 20, 2023
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改供应商SKU有效期限制页面
parent
a54e3be9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
151 additions
and
6 deletions
app/Http/Controllers/Api/SkuApiController.php
app/Http/Controllers/SkuController.php
app/Http/Services/SkuService.php
resources/views/script/SetSupplierSkuCpTimeLimitScript.blade.php
resources/views/web/SetSupplierSkuCpTimeLimit.blade.php
vendor/_laravel_idea/_ide_helper_facades.php
app/Http/Controllers/Api/SkuApiController.php
View file @
b8164862
...
...
@@ -4,14 +4,8 @@ namespace App\Http\Controllers\Api;
use
App\Http\Controllers\Controller
;
use
App\Http\Services\SkuService
;
use
App\Http\Services\SupplierContactService
;
use
App\Http\Services\SupplierStatisticsService
;
use
App\Http\Transformers\SupplierContactTransformer
;
use
App\Http\Validators\SupplierContactValidator
;
use
App\Model\RedisModel
;
use
App\Model\SkuUploadLogModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
use
Illuminate\Http\Request
;
//通用API,比如获取品牌列表,分类列表等
...
...
@@ -190,4 +184,18 @@ class SkuApiController extends Controller
$data
=
$skuService
->
getSystemTags
();
$this
->
response
(
0
,
'ok'
,
$data
,
count
(
$data
));
}
//设置有效期配置
public
function
setSupplierSkuCpTimeLimit
(
$request
)
{
$setType
=
$request
->
input
(
'set_type'
);
$supplierGroup
=
$request
->
input
(
'supplier_group'
);
$supplierCode
=
$request
->
input
(
'supplier_code'
);
$cpTimeDays
=
$request
->
input
(
'cp_time_days'
);
$result
=
(
new
SkuService
())
->
setSupplierSkuCpTimeLimit
(
$setType
,
$supplierGroup
,
$supplierCode
,
$cpTimeDays
);
if
(
!
$result
)
{
$this
->
response
(
-
1
,
'设置上架有效期失败'
);
}
$this
->
response
(
0
,
'设置上架有效期成功'
);
}
}
app/Http/Controllers/SkuController.php
View file @
b8164862
...
...
@@ -107,4 +107,12 @@ class SkuController extends Controller
$this
->
data
[
'title'
]
=
'批量修改Sku标签'
;
return
$this
->
view
(
'批量修改Sku标签'
);
}
//设置供应商的过期时间
public
function
SetSupplierSkuCpTime
(
$request
)
{
$this
->
data
[
'title'
]
=
'上架有效期配置'
;
return
$this
->
view
(
'上架有效期配置'
);
}
}
app/Http/Services/SkuService.php
View file @
b8164862
...
...
@@ -7,6 +7,7 @@ use App\Http\Controllers\Filter\SkuListFilter;
use
App\Model\IntracodeModel
;
use
App\Model\RedisModel
;
use
App\Model\SkuUploadLogModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\TagsModel
;
use
GuzzleHttp\Client
;
use
Illuminate\Support\Facades\DB
;
...
...
@@ -347,4 +348,32 @@ class SkuService
$redis
->
lpush
(
'update_list_sku'
,
$skuId
);
}
}
//设置上架有效期
public
function
setSupplierSkuCpTimeLimit
(
$setType
,
$supplierGroup
,
$supplierCode
,
$cpTimeDays
)
{
//批量设置
if
(
$setType
==
1
)
{
$suppliers
=
SupplierChannelModel
::
where
(
'supplier_group'
,
$supplierCode
)
->
select
()
->
toArray
();
if
(
!
$suppliers
)
{
foreach
(
$suppliers
as
$supplier
)
{
}
}
}
//单个设置
if
(
$setType
==
2
)
{
$supplier
=
SupplierChannelModel
::
where
(
'supplier_code'
,
$supplierCode
)
->
first
();
if
(
!
empty
(
$supplier
))
{
}
}
}
//设置供应商相关sku的队列数据
public
function
setSupplierSkuCpTimeLimitQueue
(
$supplier
)
{
}
}
\ No newline at end of file
resources/views/script/SetSupplierSkuCpTimeLimitScript.blade.php
0 → 100644
View file @
b8164862
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'table'
,
'layer'
,
'admin'
],
function
()
{
let
admin
=
layui
.
admin
;
let
form
=
layui
.
form
;
let
table
=
layui
.
table
let
element
=
layui
.
element
;
form
.
on
(
'submit(auditSupplier)'
,
function
(
data
)
{
admin
.
showLoading
({
type
:
3
});
let
supplierIds
=
getQueryVariable
(
'supplier_ids'
);
let
url
=
'/api/supplier/BatchAllocatePurchaseUser?supplier_ids='
+
supplierIds
;
$
.
ajax
({
url
:
url
,
type
:
'GET'
,
async
:
true
,
data
:
data
.
field
,
dataType
:
'json'
,
timeout
:
20000
,
success
:
function
(
res
)
{
admin
.
removeLoading
();
if
(
res
.
err_code
===
0
)
{
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
},
error
:
function
()
{
admin
.
removeLoading
();
parent
.
layer
.
msg
(
'网络错误'
,
{
icon
:
5
});
}
});
return
false
;
});
form
.
on
(
'submit(cancel)'
,
function
(
data
)
{
admin
.
closeThisDialog
();
});
});
</script>
\ No newline at end of file
resources/views/web/SetSupplierSkuCpTimeLimit.blade.php
0 → 100644
View file @
b8164862
<style>
.layui-form-item
{
margin-bottom
:
5px
;
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
style=
"height: 170px"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
渠道开发员设置
</b>
</blockquote>
<form
class=
"layui-form"
action=
""
>
<input
type=
"hidden"
name=
"supplier_ids"
value=
"{{$supplierIds}}"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_uid','渠道开发员',null,
$userCodes,['required'=>true,'width'=>'150px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 10px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
lay-filter=
"auditSupplier"
>
确认
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
lay-submit
lay-filter=
"cancel"
>
取消
</button>
</div>
</div>
</form>
</div>
<div
class=
"layui-card-body"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
当前选中需要批量修改渠道员的供应商列表
</b>
</blockquote>
<table
class=
"layui-table"
>
<colgroup>
<col
width=
"300"
>
<col
width=
"100"
>
<col>
</colgroup>
<thead>
<tr>
<th>
供应商名称
</th>
<th>
当前渠道开发员
</th>
</tr>
</thead>
<tbody>
@foreach($suppliers as $supplier)
<tr>
<td>
{{$supplier['supplier_name']}}
</td>
<td>
{{$supplier['purchase_username']}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
vendor/_laravel_idea/_ide_helper_facades.php
View file @
b8164862
This diff is collapsed.
Click to expand it.
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