Files
OMS/app/omeauto/lib/auto/plugin/examine.php
2026-01-04 19:08:31 +08:00

101 lines
3.1 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 omeauto_auto_plugin_examine extends omeauto_auto_plugin_abstract implements omeauto_auto_plugin_interface {
/**
* 是否支持批量审单
*/
protected $__SUP_REP_ROLE = true;
/**
* 状态码
*/
protected $__STATE_CODE = omeauto_auto_const::__EXAMINE_CODE;
/**
* 开始处理
*
* @param omeauto_auto_group_item $group 要处理的订单组
* @return Array
*/
public function process(&$group, &$confirmRoles=null) {
/*$allow = true;
$orders = $group->getOrders();
$fields = $this->_getCheckField($confirmRoles);
$mark = kernel::single('omeauto_auto_group_mark');
if (count($orders) <= 1) {
foreach ((array) $orders as $key => $order) {
//检查标记是否已经确认
$markText = $this->getMark($order['mark_text']);
$customText = $this->getMark($order['custom_mark']);
if ($mark->isConfirm($markText, $customText)) {
//如需检查客户留言,订单可过,但打上有备注的标记
if (in_array('custom_mark', $fields)) {
if ($customText) {
$group->setOrderStatus($order['order_id'], $this->getMsgFlag());
}
}
} else {
//备注
foreach ($fields as $field) {
if ($order[$field]) {
$allow = false;
$group->setOrderStatus($order['order_id'], $this->getMsgFlag());
}
}
}
}
if (!$allow) {
$group->setStatus(omeauto_auto_group_item::__OPT_HOLD, $this->_getPlugName());
}
}*/
}
/**
* 获取配置信息
*
* @param void
* @return array
*/
private function _getCheckField($configRoles) {
$result = array();
if ($configRoles['mark'] == '1') {
$result[] = 'custom_mark';
}
if ($configRoles['memo'] == '1') {
$result[] = 'mark_text';
}
return $result;
}
public function getTitle() {
return '批量订单';
}
public function getAlertMsg(& $order) {
return array ('color' => 'BLUE', 'flag' => '批', 'msg' => '单个有备注的订单,可以批量审单' );
}
}