Files
OMS/app/wmsmgr/lib/finder/channel.php
2026-01-04 19:08:31 +08:00

46 lines
1.8 KiB
PHP

<?php
/**
* Copyright 2012-2026 ShopeX (https://www.shopex.cn)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class wmsmgr_finder_channel
{
var $addon_cols = "channel_id";
var $column_edit = "操作";
var $column_edit_width = "180";
var $column_edit_order = "1";
function column_edit($row)
{
$materialChannelMdl = app::get('material')->model('basic_material_channel');
$channel_id = $row[$this->col_prefix . 'channel_id'];
$bind_btn = '';
$finder_id = $_GET['_finder']['finder_id'];
$url = "index.php?app=wmsmgr&ctl=admin_channel";
$bind_btn .= sprintf('<a href="index.php?app=wmsmgr&ctl=admin_wms&act=yjdf_sync_material&p[0]=%s" target="dialog::{width:600,height:350,title:\'初始化物料\'}" style="">初始化</a>', $channel_id);
//渠道商品总数
$countNum = $materialChannelMdl->count(array('channel_id'=>$channel_id));
if(empty($countNum)){
$delMsg = '确定要删除【'. $row['channel_name'] .'】此渠道吗?';
$bind_btn .= sprintf(' | <a href="javascript:if(confirm(\'%s\')){W.page(\'%s&act=delChannel&p[0]=%s&finder_id=%s\', $extend({method: \'get\'}, JSON.decode({})), this);}void(0);">删除</a>', $delMsg, $url, $channel_id, $finder_id);
}
return $bind_btn;
}
}