Files
OMS/app/omeauto/lib/auto/plugin/member.php
2025-12-28 23:13:25 +08:00

117 lines
3.1 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.
*/
/**
* 检查否需要检查同一用户订单
*
* @author hzjsq@msn.com
* @version 0.1b
*/
class omeauto_auto_plugin_member extends omeauto_auto_plugin_abstract implements omeauto_auto_plugin_interface {
/**
* 是否支持批量审单
*/
protected $__SUP_REP_ROLE = false;
/**
* 状态码
*/
protected $__STATE_CODE = omeauto_auto_const::__MEMBER_CODE;
/**
* 开始处理
*
* @param omeauto_auto_group_item $group 要处理的订单组
* @return Array
*/
public function process(& $group, &$confirmRoles=null) {
$allow = true;
if ($this->_useMemberGroup($confirmRoles)) {
$orders = $group->getOrders();
if (!empty($orders) && is_array($orders)) {
$key = key($orders);
#系统自动审单的订单,返回true
if ($orders[$key]['is_sys_auto_combine'] === true){
return true;
}
if ($orders[$key]['shop_type'] == 'shopex_b2b'){
return true;
}
if($orders[$key]['shop_type'] == 'dangdang' && $orders[$key]['is_cod']=='true'){
return true;
}
if($orders[$key]['shop_type'] == 'amazon' && $orders[$key]['self_delivery']=='false'){
return true;
}
if($orders[$key]['shop_type'] == 'aikucun'){
return true;
}
$memberId = $orders[$key]['member_id'];
$shopId = $orders[$key]['shop_id'];
if($memberId>0){
$count = kernel::single('omeauto_auto_combine')->getCombineMemberCount($memberId, $shopId);
if ($count > count($orders)) {
$allow = false;
foreach ($orders as $order) {
$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 _useMemberGroup($confirmRoles) {
return (($confirmRoles['morder'] == '1') ? true : false);
}
/**
* 获取该插件名称
*
* @param Void
* @return String
*/
public function getTitle() {
return '订单多地址';
}
/**
* 获取提示信息
*
* @param Array $order 订单内容
* @return Array
*/
public function getAlertMsg(& $order) {
return array('color' => 'GREEN', 'flag' => '多', 'msg' => '该用户还有其它不同收货地址的订单');
}
}