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
b1758952
authored
Oct 25, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
显示修改
parent
9c121073
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
3 deletions
app/Http/Controllers/Api/SkuApiController.php
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/DataService.php
app/Http/routes.php
resources/views/script/SkuListScript.blade.php
resources/views/web/SkuList.blade.php
resources/views/web/SupplierDetail.blade.php
app/Http/Controllers/Api/SkuApiController.php
View file @
b1758952
...
...
@@ -152,4 +152,25 @@ class SkuApiController extends Controller
$this
->
response
(
-
1
,
'操作失败,原因是 : '
.
$result
[
'errmsg'
]);
}
}
public
function
syncErpRate
(
$request
)
{
$url
=
'http://cron.liexin.net/ajax/quickExecTask'
;
$data
=
[
'id'
=>
'62a94bc6be29d122655f4782'
,
'job_name'
=>
'基石同步ERP美金汇率'
,
'job_list[172.18.137.41][job_etcd_name]'
=>
'83a44badeda8b393d0cceddf436d9206'
,
'job_list[172.18.137.41][etcd_key]'
=>
'/cron/jobs/172.18.137.41/基石同步ERP美金汇率'
,
'command'
=>
'/data2/ichunt-cron/crons/footstone_sync_rate.sh'
,
];
$userId
=
$request
->
cookie
(
'oa_user_id'
)
?:
$request
->
header
(
'oa_user_id'
);
$skey
=
$request
->
cookie
(
'oa_skey'
)
?:
$request
->
header
(
'oa_skey'
);
$cookie
=
'oa_user_id='
.
$userId
.
'; oa_skey='
.
$skey
;
$result
=
curl
(
$url
,
$data
,
true
,
1
,
$cookie
);
$result
=
json_decode
(
$result
,
true
);
if
(
!
empty
(
$result
)
&&
$result
[
'err_code'
]
==
0
)
{
$this
->
response
(
0
,
'请求同步成功'
);
}
$this
->
response
(
-
1
,
'请求同步失败,请联系管理员'
);
}
}
app/Http/Controllers/Api/SupplierApiController.php
View file @
b1758952
...
...
@@ -250,7 +250,7 @@ class SupplierApiController extends Controller
if
(
$result
)
{
//写日志
$logService
=
new
LogService
();
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'禁用'
,
'禁用供应商
'
);
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'禁用'
,
'禁用供应商
,理由是 : '
.
$disableReason
);
$this
->
response
(
0
,
'禁用成功'
);
}
else
{
$this
->
response
(
-
1
,
'禁用失败'
);
...
...
app/Http/Services/DataService.php
View file @
b1758952
...
...
@@ -829,4 +829,13 @@ class DataService
dd
(
$exception
);
}
}
public
function
repairData
()
{
dd
(
SupplierChannelModel
::
where
(
'supplier_id'
,
13854
)
->
first
());
SupplierChannelModel
::
where
(
'supplier_id'
,
13854
)
->
update
([
'status'
=>
SupplierChannelModel
::
STATUS_IN_REVIEW
,
'update_time'
=>
time
()
]);
}
}
\ No newline at end of file
app/Http/routes.php
View file @
b1758952
...
...
@@ -14,7 +14,6 @@
use
App\Http\Services\DepartmentService
;
use
App\Http\Services\SkuService
;
use
Mavinoo\Batch\Batch
;
Route
::
group
([
'middleware'
=>
[
'web'
,
'menu'
]],
function
()
{
Route
::
get
(
'/'
,
'WebController@Entrance'
);
...
...
@@ -64,5 +63,4 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
});
resources/views/script/SkuListScript.blade.php
View file @
b1758952
...
...
@@ -258,6 +258,24 @@
});
});
$
(
'#sync_erp_rate'
).
click
(
function
()
{
$
.
ajax
({
type
:
'post'
,
url
:
'/api/sku/syncErpRate'
,
timeout
:
30000
,
//超时时间设置,单位毫秒
dataType
:
'json'
,
success
:
function
(
res
)
{
console
.
log
(
res
);
if
(
res
.
err_code
===
0
)
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
return
false
;
}
}
});
});
//批量上下架操作
function
batchUpdateGoodsStatus
(
skuIds
,
status
)
{
let
statusName
=
status
===
'offshelf'
?
'下架'
:
'上架'
;
...
...
resources/views/web/SkuList.blade.php
View file @
b1758952
...
...
@@ -12,6 +12,7 @@
@endif
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
set_prefer
">设置精选</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
cancel_set_prefer
">取消精选</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
sync_erp_rate
">同步ERP汇率</button>
</div>
<table class="
layui
-
table
" id="
skuList
" lay-filter="
skuList
"></table>
...
...
resources/views/web/SupplierDetail.blade.php
View file @
b1758952
...
...
@@ -178,6 +178,11 @@
<div
class=
"layui-row"
>
<span
class=
"required_field"
>
*
</span>
主营品牌 :{{$supplier['main_brand_names']}}
</div>
@if($supplier['supplier_group'] == \App\Model\SupplierChannelModel::SUPPLIER_GROUP_MIX)
<div
class=
"layui-row"
>
<span
class=
"required_field"
>
*
</span>
代理品牌 :{{$supplier['main_brand_names']}}
</div>
@endif
<div
class=
"layui-row"
>
3-5家客户 :{{$supplier['main_customers']}}
</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