Browse Source

重建配套订单

lizhen_gitee 7 months ago
parent
commit
5941a280b5

+ 2 - 0
application/admin/controller/Packageorder.php

@@ -28,8 +28,10 @@ class Packageorder extends Backend
         $this->model = new \app\admin\model\Packageorder;
         $this->view->assign("orderStatusList", $this->model->getOrderStatusList());
         $this->view->assign("useStatusList", $this->model->getUseStatusList());
+        $this->view->assign("payTypeList", $this->model->getPayTypeList());
         $this->view->assign("isGiftList", $this->model->getIsGiftList());
         $this->view->assign("noticeStatusList", $this->model->getNoticeStatusList());
+        $this->view->assign("buyNoticeStatusList", $this->model->getBuyNoticeStatusList());
     }
 
 

+ 40 - 36
application/admin/lang/zh-cn/packageorder.php

@@ -1,40 +1,44 @@
 <?php
 
 return [
-    'Id'              => 'id',
-    'Order_no'        => '订单号',
-    'User_id'         => '用户id',
-    'Package_id'      => '配套id',
-    'Lesson_ids'      => '课程ids',
-    'Sessions'        => '共计获得课程数量',
-    'Starttime'       => '激活时间',
-    'Days'            => '实际有效天数',
-    'Endtime'         => '到期时间',
-    'Price'           => '价格',
-    'Remain'          => '剩余课程数量',
-    'Order_status'    => '状态',
-    'Order_status 0'  => '待支付',
-    'Order_status 1'  => '已支付',
-    'Use_status'      => '激活状态',
-    'Use_status 0'    => '未激活',
-    'Use_status 1'    => '已激活',
-    'Paytime'         => '支付时间',
-    'Pay_type'        => '支付方式',
-    'Pay_type 1'      => '线上',
-    'Pay_type 2'      => '线下',
-    'Createtime'      => '创建时间',
-    'Updatetime'      => '更新时间',
-    'Is_gift'         => '是否赠品',
-    'Is_gift 0'       => '否',
-    'Is_gift 1'       => '是',
-    'Notice_status'   => '计划任务',
-    'Notice_status 0' => '未通知',
-    'Notice_status 1' => '一月通知',
-    'Notice_status 2' => '两周通知',
-    'Notice_status 3' => '一周通知',
-    'Remark'          => '备注',
-    'User.firstname'  => '名',
-    'User.lastname'   => '姓',
-    'Package.name'    => '配套标题',
-    'Package.name_en' => '配套标题(en)'
+    'Id'                  => 'id',
+    'Order_no'            => '订单号',
+    'User_id'             => '用户id',
+    'Package_id'          => '配套id',
+    'Lesson_ids'          => '课程ids',
+    'Sessions'            => '共计获得课程数量',
+    'Starttime'           => '激活时间',
+    'Days'                => '实际有效天数',
+    'Endtime'             => '到期时间',
+    'Price'               => '价格',
+    'Remain'              => '剩余课程数量',
+    'Order_status'        => '状态',
+    'Order_status 0'      => '待支付',
+    'Order_status 1'      => '已支付',
+    'Order_status 10'     => '已删除',
+    'Use_status'          => '激活状态',
+    'Use_status 0'        => '未激活',
+    'Use_status 1'        => '已激活',
+    'Paytime'             => '支付时间',
+    'Pay_type'            => '支付方式',
+    'Pay_type 1'          => '线上',
+    'Pay_type 2'          => '线下',
+    'Createtime'          => '创建时间',
+    'Updatetime'          => '更新时间',
+    'Is_gift'             => '是否赠品',
+    'Is_gift 0'           => '否',
+    'Is_gift 1'           => '是',
+    'Notice_status'       => '计划任务',
+    'Notice_status 0'     => '未通知',
+    'Notice_status 1'     => '一月通知',
+    'Notice_status 2'     => '两周通知',
+    'Notice_status 3'     => '一周通知',
+    'Remark'              => '备注',
+    'Buy_notice_status'   => '购买通知计划任务',
+    'Buy_notice_status 0' => '未通知',
+    'Buy_notice_status 1' => '已通知',
+    'User.firstname'      => '名',
+    'User.lastname'       => '姓',
+    'Package.name'        => '配套标题',
+    'Package.name_en'     => '配套标题(en)'
 ];

+ 31 - 2
application/admin/model/Packageorder.php

@@ -30,21 +30,29 @@ class Packageorder extends Model
         'order_status_text',
         'use_status_text',
         'paytime_text',
+        'pay_type_text',
         'is_gift_text',
-        'notice_status_text'
+        'notice_status_text',
+        'buy_notice_status_text'
     ];
     
 
     
     public function getOrderStatusList()
     {
-        return ['0' => __('Order_status 0'), '1' => __('Order_status 1')];
+        return ['0' => __('Order_status 0'), '1' => __('Order_status 1'), '10' => __('Order_status 10')];
     }
+
     public function getUseStatusList()
     {
         return ['0' => __('Use_status 0'), '1' => __('Use_status 1')];
     }
 
+    public function getPayTypeList()
+    {
+        return ['1' => __('Pay_type 1'), '2' => __('Pay_type 2')];
+    }
+
     public function getIsGiftList()
     {
         return ['0' => __('Is_gift 0'), '1' => __('Is_gift 1')];
@@ -55,6 +63,11 @@ class Packageorder extends Model
         return ['0' => __('Notice_status 0'), '1' => __('Notice_status 1'), '2' => __('Notice_status 2'), '3' => __('Notice_status 3')];
     }
 
+    public function getBuyNoticeStatusList()
+    {
+        return ['0' => __('Buy_notice_status 0'), '1' => __('Buy_notice_status 1')];
+    }
+
 
     public function getStarttimeTextAttr($value, $data)
     {
@@ -93,6 +106,14 @@ class Packageorder extends Model
     }
 
 
+    public function getPayTypeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : '');
+        $list = $this->getPayTypeList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
     public function getIsGiftTextAttr($value, $data)
     {
         $value = $value ? $value : (isset($data['is_gift']) ? $data['is_gift'] : '');
@@ -108,6 +129,14 @@ class Packageorder extends Model
         return isset($list[$value]) ? $list[$value] : '';
     }
 
+
+    public function getBuyNoticeStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['buy_notice_status']) ? $data['buy_notice_status'] : '');
+        $list = $this->getBuyNoticeStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
     protected function setStarttimeAttr($value)
     {
         return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);

+ 7 - 6
public/assets/js/backend/packageorder.js

@@ -36,21 +36,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'package_id', title: __('Package_id')},
                         {field: 'package.name', title: __('Package.name'), operate: 'LIKE'},
                         {field: 'package.name_en', title: __('Package.name_en'), operate: 'LIKE'},
-//                        {field: 'lesson_ids', title: __('Lesson_ids')},
+//                        {field: 'lesson_ids', title: __('Lesson_ids'), operate: false},
                         {field: 'sessions', title: __('Sessions')},
                         {field: 'starttime', title: __('Starttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'days', title: __('Days')},
                         {field: 'endtime', title: __('Endtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
-                        {field: 'price', title: __('Price'), operate:'BETWEEN'},
-                        {field: 'remain', title: __('Remain')},
-                        {field: 'order_status', title: __('Order_status'), searchList: {"0":__('Order_status 0'),"1":__('Order_status 1')}, formatter: Table.api.formatter.status},
-                        {field: 'pay_type', title: __('Pay_type'), searchList: {"1":__('Pay_type 1'),"2":__('Pay_type 2')}, formatter: Table.api.formatter.status},
+                        {field: 'price', title: __('Price'), operate:false},
+                        {field: 'remain', title: __('Remain'), operate:false},
+                        {field: 'order_status', title: __('Order_status'), searchList: {"0":__('Order_status 0'),"1":__('Order_status 1'),"10":__('Order_status 10')}, formatter: Table.api.formatter.status},
+                        {field: 'pay_type', title: __('Pay_type'), searchList: {"1":__('Pay_type 1'),"2":__('Pay_type 2')}, formatter: Table.api.formatter.normal},
                         {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'is_gift', title: __('Is_gift'), searchList: {"0":__('Is_gift 0'),"1":__('Is_gift 1')}, formatter: Table.api.formatter.normal},
 //                        {field: 'notice_status', title: __('Notice_status'), searchList: {"0":__('Notice_status 0'),"1":__('Notice_status 1'),"2":__('Notice_status 2'),"3":__('Notice_status 3')}, formatter: Table.api.formatter.status},
-                        {field: 'remark', title: __('Remark'),operate:false},
+                        {field: 'remark', title: __('Remark'), operate: false},
+//                        {field: 'buy_notice_status', title: __('Buy_notice_status'), searchList: {"0":__('Buy_notice_status 0'),"1":__('Buy_notice_status 1')}, formatter: Table.api.formatter.status},