1.提交缺失的东西

This commit is contained in:
2025-05-17 15:29:23 +08:00
parent 749796be64
commit 29eab7e6c4
2 changed files with 66 additions and 4 deletions

View File

@ -80,13 +80,13 @@ class OrderController extends BaseApiController
{
$order_id = $this->request->get('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) {
$this->_error('订单不存在了!', '');
return $this->fail('订单不存在了!');
}
$this->_success('获取成功', $order_detail);
return $this->success('获取成功', $order_detail);
}
/**

View 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] ?? '未知';
}
}