Commit b1758952 by 杨树贤

显示修改

parent 9c121073
......@@ -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, '请求同步失败,请联系管理员');
}
}
......@@ -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, '禁用失败');
......
......@@ -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
......@@ -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 () {
});
......@@ -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' ? '下架' : '上架';
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment