1.提交缺失的东西
This commit is contained in:
@ -80,13 +80,13 @@ class OrderController extends BaseApiController
|
|||||||
{
|
{
|
||||||
$order_id = $this->request->get('id');
|
$order_id = $this->request->get('id');
|
||||||
if (!$order_id){
|
if (!$order_id){
|
||||||
$this->_error('请选择订单');
|
return $this->fail('请选择订单');
|
||||||
}
|
}
|
||||||
$order_detail = OrderLogic::getOrderDetail($order_id, $this->user_id);
|
$order_detail = OrderLogic::getOrderDetail($order_id, $this->userId);
|
||||||
if (!$order_detail) {
|
if (!$order_detail) {
|
||||||
$this->_error('订单不存在了!', '');
|
return $this->fail('订单不存在了!');
|
||||||
}
|
}
|
||||||
$this->_success('获取成功', $order_detail);
|
return $this->success('获取成功', $order_detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
62
app/common/model/OrderGoods.php
Normal file
62
app/common/model/OrderGoods.php
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | likeshop开源商城系统
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
|
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||||
|
// | github下载:https://github.com/likeshop-github
|
||||||
|
// | 访问官网:https://www.likeshop.cn
|
||||||
|
// | 访问社区:https://home.likeshop.cn
|
||||||
|
// | 访问手册:http://doc.likeshop.cn
|
||||||
|
// | 微信公众号:likeshop技术社区
|
||||||
|
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||||
|
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||||
|
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||||
|
// | likeshop团队版权所有并拥有最终解释权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | author: likeshop.cn.team
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace app\common\model;
|
||||||
|
|
||||||
|
use app\common\service\UrlServer;
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
class OrderGoods extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
//订单商品退款状态
|
||||||
|
const REFUND_STATUS_NO = 0;//未申请退款
|
||||||
|
const REFUND_STATUS_APPLY = 1;//申请退款
|
||||||
|
const REFUND_STATUS_WAIT = 2;//等待退款
|
||||||
|
const REFUND_STATUS_SUCCESS = 3;//退款成功
|
||||||
|
|
||||||
|
public function getImageAttr($value, $data)
|
||||||
|
{
|
||||||
|
if ($value) {
|
||||||
|
return UrlServer::getFileUrl($value);
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseImageAttr($value, $data)
|
||||||
|
{
|
||||||
|
return $data['image'];
|
||||||
|
}
|
||||||
|
|
||||||
|
//退款状态
|
||||||
|
public static function getRefundStatus($type)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
self::REFUND_STATUS_NO => '未申请退款',
|
||||||
|
self::REFUND_STATUS_APPLY => '申请退款',
|
||||||
|
self::REFUND_STATUS_WAIT => '等待退款',
|
||||||
|
self::REFUND_STATUS_SUCCESS => '退款成功',
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($type === true) {
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
return $data[$type] ?? '未知';
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user