Files
OMS/app/invoice/lib/finder/channel.php
2025-12-28 23:13:25 +08:00

64 lines
3.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
class invoice_finder_channel{
var $addon_cols = "channel_type,shop_id,node_id";
var $column_control = '操作';
var $column_control_width = '150';
var $column_control_order = COLUMN_IN_HEAD;
function column_control($row){
$channel_id = $row['channel_id'];
$channel_type = $row[$this->col_prefix.'channel_type'];
$button = "<a href='javascript:void(0);' onclick=\"new Dialog('index.php?app=invoice&ctl=admin_channel&act=edit&p[0]={$channel_id}&finder_id={$_GET['_finder']['finder_id']}',{width:620,height:460,title:'来源添加/编辑'}); \">编辑</a>";
$status = $row['status'];
if ($status == 'true') {
$todo = 'false';
$button_2 = sprintf('<a style="color: green" href="javascript:if (confirm(\'如果关闭,则电子发票渠道不可用!\')){W.page(\'index.php?app=invoice&ctl=admin_channel&act=status&p[0]=%s&p[1]=%s&finder_id=%s\', $extend({method: \'get\'}, JSON.decode({})), this);}void(0);" target="">开启</a>', $todo,$row['channel_id'],$_GET['_finder']['finder_id']);
}else{
$todo = 'true';
$button_2 = sprintf('<a style="color: red" href="javascript:if (confirm(\'如果开启,则继续使用电子发票渠道!\')){W.page(\'index.php?app=invoice&ctl=admin_channel&act=status&p[0]=%s&p[1]=%s&finder_id=%s\', $extend({method: \'get\'}, JSON.decode({})), this);}void(0);" target="">关闭</a>', $todo,$row['channel_id'],$_GET['_finder']['finder_id']);
}
$btns = [
$button_2,
$button,
];
// 判断是否已经绑定
if ($row[$this->col_prefix.'node_id']){
$btns[] = sprintf('<a style="color: darkred" href="javascript:if (confirm(\'如果解绑,则渠道将无法开票!\')){W.page(\'index.php?app=invoice&ctl=admin_channel&act=unbind&p[0]=%s&finder_id=%s\', $extend({method: \'get\'}, JSON.decode({})), this);}void(0);" target="">解绑</a>', $row['channel_id'],$_GET['_finder']['finder_id']);
}
return implode(' | ', $btns);
}
var $column_channel_type = '来源类型';
var $column_channel_type_width = '80';
var $column_channel_type_order = COLUMN_IN_TAIL;
function column_channel_type($row){
$funcObj = kernel::single('invoice_func');
$channel_type = $row[$this->col_prefix.'channel_type'];
$channels = $funcObj->channels($channel_type);
if($channels) {
return $channels['name'];
} else {
return '未知';
}
}
/* var $column_shop = '店铺';
var $column_shop_width = '150';
var $column_shop_order = COLUMN_IN_TAIL;
function column_shop($row){
if($row[$this->col_prefix.'channel_type'] == 'taobao') {
$shopObj = app::get('ome')->model('shop');
$shop = $shopObj->dump($row[$this->col_prefix.'shop_id'],'name');
return $shop['name'];
}else {
return '全部';
}
} */
}