订单、插件信息读取优化
parent
a37abf0ce9
commit
755219dbd7
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://opensource.org/licenses/mit-license.php )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 路由设置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// URL伪静态后缀
|
||||
'url_html_suffix' => MyFileConfig('home_seo_url_html_suffix', '', 'html', true),
|
||||
];
|
||||
?>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://opensource.org/licenses/mit-license.php )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\hljapi\controller;
|
||||
|
||||
use app\service\ApiService;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* token授权 - 黑龙江政采
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class AccessToken extends Common
|
||||
{
|
||||
/**
|
||||
* 预占订单
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function Index()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'base', 'accesstoken', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://opensource.org/licenses/mit-license.php )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\hljapi\controller;
|
||||
|
||||
use app\BaseController;
|
||||
use app\service\ApiService;
|
||||
use app\service\ConfigService;
|
||||
use app\service\SystemService;
|
||||
|
||||
/**
|
||||
* 接口公共控制器 - 黑龙江政采
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Common extends BaseController
|
||||
{
|
||||
// 输入参数 post|get|request
|
||||
protected $data_post;
|
||||
protected $data_get;
|
||||
protected $data_request;
|
||||
|
||||
// 当前系统操作名称
|
||||
protected $module_name;
|
||||
protected $controller_name;
|
||||
protected $action_name;
|
||||
|
||||
// 当前插件操作名称
|
||||
protected $plugins_module_name;
|
||||
protected $plugins_controller_name;
|
||||
protected $plugins_action_name;
|
||||
|
||||
// 分页信息
|
||||
protected $page;
|
||||
protected $page_size;
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-11-30
|
||||
* @desc description
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// 检测是否是新安装
|
||||
SystemService::SystemInstallCheck();
|
||||
|
||||
// 输入参数
|
||||
$this->data_post = input('post.');
|
||||
$this->data_get = input('get.');
|
||||
$this->data_request = input();
|
||||
|
||||
// 系统运行开始
|
||||
SystemService::SystemBegin($this->data_request);
|
||||
|
||||
// 系统初始化
|
||||
$this->SystemInit();
|
||||
|
||||
// 公共数据初始化
|
||||
$this->CommonInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 析构函数
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-18
|
||||
* @desc description
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
// 系统运行结束
|
||||
SystemService::SystemEnd($this->data_request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统初始化
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-07
|
||||
* @desc description
|
||||
*/
|
||||
private function SystemInit()
|
||||
{
|
||||
// 配置信息初始化
|
||||
ConfigService::ConfigInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共数据初始化
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-09T11:43:48+0800
|
||||
*/
|
||||
private function CommonInit()
|
||||
{
|
||||
// 当前系统操作名称
|
||||
$this->module_name = RequestModule();
|
||||
$this->controller_name = RequestController();
|
||||
$this->action_name = RequestAction();
|
||||
|
||||
// 当前插件操作名称, 兼容插件模块名称
|
||||
if(empty($this->data_request['pluginsname']))
|
||||
{
|
||||
$this->plugins_module_name = '';
|
||||
$this->plugins_controller_name = '';
|
||||
$this->plugins_action_name = '';
|
||||
} else {
|
||||
$this->plugins_module_name = $this->data_request['pluginsname'];
|
||||
$this->plugins_controller_name = empty($this->data_request['pluginscontrol']) ? 'index' : $this->data_request['pluginscontrol'];
|
||||
$this->plugins_action_name = empty($this->data_request['pluginsaction']) ? 'index' : $this->data_request['pluginsaction'];
|
||||
}
|
||||
|
||||
// 分页信息
|
||||
$this->page = max(1, isset($this->data_request['page']) ? intval($this->data_request['page']) : 1);
|
||||
$this->page_size = 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* 空方法响应
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-11-30
|
||||
* @desc description
|
||||
* @param [string] $method [方法名称]
|
||||
* @param [array] $args [参数]
|
||||
*/
|
||||
public function __call($method, $args)
|
||||
{
|
||||
return ApiService::ApiDataReturn('{"success":false,"resultMsg":"'.$method.'非法访问'.'","resultCode":"07","result":""}');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类属性数据
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-06-07
|
||||
* @desc description
|
||||
*/
|
||||
public function GetClassVars()
|
||||
{
|
||||
$data = [];
|
||||
$vers = get_class_vars(get_class());
|
||||
foreach($vers as $k=>$v)
|
||||
{
|
||||
if(property_exists($this, $k))
|
||||
{
|
||||
$data[$k] = $this->$k;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://opensource.org/licenses/mit-license.php )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\hljapi\controller;
|
||||
|
||||
use app\service\ApiService;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 订单 - 黑龙江政采
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Order extends Common
|
||||
{
|
||||
/**
|
||||
* 预占订单
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function submitPreOrder()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'order', 'add', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认预占订单
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function confirmPreOrder()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'order', 'confirm', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消预占订单
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function cancelPreOrder()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'order', 'cancel', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认收货
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function confirmReceipt()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'order', 'collect', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单物流查询
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function getOrderLogisticsInfo()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'order', 'express', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://opensource.org/licenses/mit-license.php )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\hljapi\controller;
|
||||
|
||||
use app\service\ApiService;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 商品 - 黑龙江政采
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Product extends Common
|
||||
{
|
||||
/**
|
||||
* 商品价格查询
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function getSellPrice()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'goods', 'price', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品库存查询
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function getStock()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'goods', 'inventory', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品可售查询
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function saleCheck()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'goods', 'issales', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品上下架通知
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function shelfUpdateNotice()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'goods', 'shelves', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品是否支持货到付款
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @desc description
|
||||
*/
|
||||
public function checkIsCod()
|
||||
{
|
||||
$ret = PluginsService::PluginsControlCall('govpurheilongjiang', 'goods', 'iscod', 'api', $this->GetClassVars());
|
||||
return ApiService::ApiDataReturn($ret['data']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1226,6 +1226,15 @@ class OrderService
|
|||
$result = [];
|
||||
if(!empty($data))
|
||||
{
|
||||
// 订单列表钩子-前面
|
||||
$hook_name = 'plugins_service_order_list_handle_begin';
|
||||
MyEventTrigger($hook_name, [
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
'params' => &$params,
|
||||
'data' => &$data,
|
||||
]);
|
||||
|
||||
// 字段列表
|
||||
$keys = ArrayKeys($data);
|
||||
$order_ids = array_column($data, 'id');
|
||||
|
|
@ -1280,6 +1289,9 @@ class OrderService
|
|||
// 订单地址
|
||||
$address_data = self::OrderAddressData($order_ids);
|
||||
|
||||
// 订单详情
|
||||
$detail = ($is_items == 1) ? self::OrderItemList($data, $is_orderaftersale) : [];
|
||||
|
||||
// 循环处理数据
|
||||
foreach($data as &$v)
|
||||
{
|
||||
|
|
@ -1405,13 +1417,10 @@ class OrderService
|
|||
$v['extension_data'] = empty($v['extension_data']) ? null : json_decode($v['extension_data'], true);
|
||||
|
||||
// 订单详情
|
||||
if($is_items == 1)
|
||||
if($is_items == 1 && !empty($detail) && array_key_exists($v['id'], $detail))
|
||||
{
|
||||
$items = self::OrderItemList($v['id'], $v['order_model'], $v['status'], $v['pay_status'], $is_orderaftersale);
|
||||
$v['items'] = $items;
|
||||
$v['items_count'] = count($items);
|
||||
|
||||
// 描述
|
||||
$v['items'] = $detail[$v['id']];
|
||||
$v['items_count'] = count($v['items']);
|
||||
$v['describe'] = '共'.$v['buy_number_count'].'件 合计:'.$v['currency_data']['currency_symbol'].$v['total_price'].'元';
|
||||
}
|
||||
|
||||
|
|
@ -1442,6 +1451,15 @@ class OrderService
|
|||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
// 订单列表钩子-后面
|
||||
$hook_name = 'plugins_service_order_list_handle_end';
|
||||
MyEventTrigger($hook_name, [
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
'params' => &$params,
|
||||
'data' => &$data,
|
||||
]);
|
||||
}
|
||||
|
||||
return DataReturn('success', 0, $data);
|
||||
|
|
@ -1530,66 +1548,99 @@ class OrderService
|
|||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-05-15
|
||||
* @date 2022-06-22
|
||||
* @desc description
|
||||
* @param [int] $order_id [订单 id]
|
||||
* @param [int] $order_model [订单模式]
|
||||
* @param [int] $status [订单状态]
|
||||
* @param [int] $pay_status [支付状态]
|
||||
* @param [int] $is_orderaftersale [是否读取订单售后(0否, 1是)]
|
||||
* @param [array] $order [订单信息]
|
||||
* @param [int] $is_orderaftersale [是否读取订单售后(0否, 1是)]
|
||||
*/
|
||||
public static function OrderItemList($order_id, $order_model, $status, $pay_status, $is_orderaftersale = 0)
|
||||
public static function OrderItemList($order, $is_orderaftersale = 0)
|
||||
{
|
||||
$data = Db::name('OrderDetail')->where(['order_id'=>$order_id])->select()->toArray();
|
||||
$result = [];
|
||||
$order = array_column($order, null, 'id');
|
||||
$order_ids = array_keys($order);
|
||||
$data = Db::name('OrderDetail')->where(['order_id'=>$order_ids])->select()->toArray();
|
||||
if(!empty($data))
|
||||
{
|
||||
// 订单详情自增id
|
||||
$order_detail_ids = array_column($data, 'id');
|
||||
|
||||
// 虚拟商品取货码
|
||||
$fictitious_value_list = Db::name('OrderFictitiousValue')->where(['order_detail_id'=>array_column($data, 'id')])->column('value', 'order_detail_id');
|
||||
$fictitious_value_list = Db::name('OrderFictitiousValue')->where(['order_detail_id'=>$order_detail_ids])->column('value', 'order_detail_id');
|
||||
|
||||
// 是否获取最新一条售后信息
|
||||
$orderaftersale = [];
|
||||
if($is_orderaftersale == 1)
|
||||
{
|
||||
$temp_aftersale = Db::name('OrderAftersale')->where(['order_detail_id'=>$order_detail_ids])->order('id desc')->select()->toArray();
|
||||
if(!empty($temp_aftersale))
|
||||
{
|
||||
foreach($temp_aftersale as $av)
|
||||
{
|
||||
if(!array_key_exists($av['order_detail_id'], $orderaftersale))
|
||||
{
|
||||
$orderaftersale[$av['order_detail_id']] = $av;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 商品处理
|
||||
$res = GoodsService::GoodsDataHandle($data, ['data_key_field'=>'goods_id']);
|
||||
$data = $res['data'];
|
||||
foreach($data as &$vs)
|
||||
foreach($data as $vs)
|
||||
{
|
||||
// 避免订单商品价格被处理,强制使用原始内容
|
||||
if(!empty($vs['price_container']))
|
||||
// 当前商品订单信息
|
||||
if(array_key_exists($vs['order_id'], $order))
|
||||
{
|
||||
$vs['price'] = $vs['price_container']['price'];
|
||||
$vs['original_price'] = $vs['price_container']['original_price'];
|
||||
}
|
||||
// 当前商品详情主订单信息
|
||||
$ov = $order[$vs['order_id']];
|
||||
|
||||
// 规格
|
||||
$vs['spec_text'] = null;
|
||||
if(!empty($vs['spec']))
|
||||
{
|
||||
$vs['spec'] = json_decode($vs['spec'], true);
|
||||
if(!empty($vs['spec']) && is_array($vs['spec']))
|
||||
// 避免订单商品价格被处理,强制使用原始内容
|
||||
if(!empty($vs['price_container']))
|
||||
{
|
||||
$vs['spec_text'] = implode(',', array_map(function($spec)
|
||||
{
|
||||
return $spec['type'].':'.$spec['value'];
|
||||
}, $vs['spec']));
|
||||
$vs['price'] = $vs['price_container']['price'];
|
||||
$vs['original_price'] = $vs['price_container']['original_price'];
|
||||
}
|
||||
} else {
|
||||
$vs['spec'] = null;
|
||||
}
|
||||
|
||||
// 虚拟销售商品 - 虚拟信息处理
|
||||
if($order_model == 3 && $pay_status == 1 && in_array($status, [3,4]))
|
||||
{
|
||||
$vs['fictitious_goods_value'] = (!empty($fictitious_value_list) && is_array($fictitious_value_list) && array_key_exists($vs['id'], $fictitious_value_list)) ? $fictitious_value_list[$vs['id']] : '';
|
||||
}
|
||||
// 规格
|
||||
$vs['spec_text'] = null;
|
||||
if(!empty($vs['spec']))
|
||||
{
|
||||
$vs['spec'] = json_decode($vs['spec'], true);
|
||||
if(!empty($vs['spec']) && is_array($vs['spec']))
|
||||
{
|
||||
$vs['spec_text'] = implode(',', array_map(function($spec)
|
||||
{
|
||||
return $spec['type'].':'.$spec['value'];
|
||||
}, $vs['spec']));
|
||||
}
|
||||
} else {
|
||||
$vs['spec'] = null;
|
||||
}
|
||||
|
||||
// 是否获取最新一条售后信息
|
||||
if($is_orderaftersale == 1)
|
||||
{
|
||||
$orderaftersale = Db::name('OrderAftersale')->where(['order_detail_id'=>$vs['id']])->order('id desc')->find();
|
||||
$vs['orderaftersale'] = $orderaftersale;
|
||||
$vs['orderaftersale_btn_text'] = self::OrderAftersaleStatusBtnText($status, $orderaftersale);
|
||||
// 虚拟销售商品 - 虚拟信息处理
|
||||
if($ov['order_model'] == 3 && $ov['pay_status'] == 1 && in_array($ov['status'], [3,4]))
|
||||
{
|
||||
$vs['fictitious_goods_value'] = (!empty($fictitious_value_list) && is_array($fictitious_value_list) && array_key_exists($vs['id'], $fictitious_value_list)) ? $fictitious_value_list[$vs['id']] : '';
|
||||
}
|
||||
|
||||
// 是否获取最新一条售后信息
|
||||
if($is_orderaftersale == 1 && !empty($orderaftersale) && array_key_exists($vs['id'], $orderaftersale))
|
||||
{
|
||||
$vs['orderaftersale'] = $orderaftersale[$vs['id']];
|
||||
$vs['orderaftersale_btn_text'] = self::OrderAftersaleStatusBtnText($ov['status'], $vs['orderaftersale']);
|
||||
}
|
||||
|
||||
// 加入分组
|
||||
if(!array_key_exists($vs['order_id'], $result))
|
||||
{
|
||||
$result[$vs['order_id']] = [];
|
||||
}
|
||||
$result[$vs['order_id']][] = $vs;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class PluginsService
|
|||
{
|
||||
// 从缓存获取数据、数据不存在则从数据库读取
|
||||
$data = ($is_cache === true) ? self::PluginsCacheData($plugins) : [];
|
||||
if($data === null || !$is_cache)
|
||||
if(empty($data) || !$is_cache)
|
||||
{
|
||||
// 获取数据
|
||||
$ret = self::PluginsField($plugins, 'data');
|
||||
|
|
|
|||
Loading…
Reference in New Issue