diff --git a/app/Console/Tasks/RefundTask.php b/app/Console/Tasks/RefundTask.php index 8c1d6eca..04cd5cfb 100644 --- a/app/Console/Tasks/RefundTask.php +++ b/app/Console/Tasks/RefundTask.php @@ -97,7 +97,7 @@ class RefundTask extends Task $task->try_count += 1; $task->priority += 1; - if ($task->try_count > self::TRY_COUNT) { + if ($task->try_count >= self::TRY_COUNT) { $task->status = TaskModel::STATUS_FAILED; } @@ -161,6 +161,9 @@ class RefundTask extends Task case OrderModel::ITEM_VIP: $this->handleVipOrderRefund($order); break; + case OrderModel::ITEM_REWARD: + $this->handleRewardOrderRefund($order); + break; case OrderModel::ITEM_TEST: $this->handleTestOrderRefund($order); break; @@ -247,6 +250,16 @@ class RefundTask extends Task } } + /** + * 处理测试订单退款 + * + * @param OrderModel $order + */ + protected function handleRewardOrderRefund(OrderModel $order) + { + + } + /** * 处理测试订单退款 * diff --git a/app/Console/Tasks/SyncCourseIndexTask.php b/app/Console/Tasks/SyncCourseIndexTask.php index dd17c9bf..e27ace7b 100644 --- a/app/Console/Tasks/SyncCourseIndexTask.php +++ b/app/Console/Tasks/SyncCourseIndexTask.php @@ -4,8 +4,8 @@ namespace App\Console\Tasks; use App\Library\Cache\Backend\Redis as RedisCache; use App\Repos\Course as CourseRepo; -use App\Searchers\CourseDocument; -use App\Searchers\CourseSearch; +use App\Services\Search\CourseDocument; +use App\Services\Search\CourseHandler; use App\Services\Syncer\CourseIndex as CourseIndexSyncer; class SyncCourseIndexTask extends Task @@ -48,9 +48,9 @@ class SyncCourseIndexTask extends Task $document = new CourseDocument(); - $searcher = new CourseSearch(); + $handler = new CourseHandler(); - $index = $searcher->getXS()->getIndex(); + $index = $handler->getXS()->getIndex(); $index->openBuffer(); diff --git a/app/Http/Admin/Services/Consult.php b/app/Http/Admin/Services/Consult.php index 509ae61d..e668f61e 100644 --- a/app/Http/Admin/Services/Consult.php +++ b/app/Http/Admin/Services/Consult.php @@ -60,6 +60,10 @@ class Consult extends Service $data['answer'] = $validator->checkAnswer($post['answer']); } + if (isset($post['private'])) { + $data['private'] = $validator->checkPrivateStatus($post['private']); + } + if (isset($post['published'])) { $data['published'] = $validator->checkPublishStatus($post['published']); } diff --git a/app/Http/Admin/Services/Order.php b/app/Http/Admin/Services/Order.php index 1ce06e5f..23ea85b2 100644 --- a/app/Http/Admin/Services/Order.php +++ b/app/Http/Admin/Services/Order.php @@ -4,7 +4,6 @@ namespace App\Http\Admin\Services; use App\Builders\OrderList as OrderListBuilder; use App\Library\Paginator\Query as PaginateQuery; -use App\Models\Order as OrderModel; use App\Repos\Account as AccountRepo; use App\Repos\Order as OrderRepo; use App\Repos\User as UserRepo; @@ -62,18 +61,6 @@ class Order extends Service return $this->findOrFail($id); } - public function closeOrder($id) - { - $order = $this->findOrFail($id); - - if ($order->status == OrderModel::STATUS_PENDING) { - $order->status = OrderModel::STATUS_CLOSED; - $order->update(); - } - - return $order; - } - protected function findOrFail($id) { $validator = new OrderValidator(); diff --git a/app/Http/Admin/Services/Trade.php b/app/Http/Admin/Services/Trade.php index 5fec01b3..c0279fb4 100644 --- a/app/Http/Admin/Services/Trade.php +++ b/app/Http/Admin/Services/Trade.php @@ -5,7 +5,6 @@ namespace App\Http\Admin\Services; use App\Builders\TradeList as TradeListBuilder; use App\Library\Paginator\Query as PaginateQuery; use App\Models\Refund as RefundModel; -use App\Models\Trade as TradeModel; use App\Repos\Account as AccountRepo; use App\Repos\Order as OrderRepo; use App\Repos\Trade as TradeRepo; @@ -76,21 +75,6 @@ class Trade extends Service return $accountRepo->findById($userId); } - public function closeTrade($id) - { - $trade = $this->findOrFail($id); - - $validator = new TradeValidator(); - - $validator->checkIfAllowClose($trade); - - $trade->status = TradeModel::STATUS_CLOSED; - - $trade->update(); - - return $trade; - } - public function refundTrade($id) { $trade = $this->findOrFail($id); diff --git a/app/Http/Admin/Views/comment/list.volt b/app/Http/Admin/Views/comment/list.volt index 93c34971..a470689a 100644 --- a/app/Http/Admin/Views/comment/list.volt +++ b/app/Http/Admin/Views/comment/list.volt @@ -43,13 +43,13 @@ {% if item.chapter %}

章节:{{ item.chapter.title }}

{% endif %} -

评论:{{ substr(item.content,0,25) }}

+

评论:{{ substr(item.content,0,30) }}

昵称:{{ item.user.name }}

编号:{{ item.user.id }}

- {{ date('Y-m-d H:i',item.create_time) }} + {{ date('Y-m-d H:i:s',item.create_time) }}
diff --git a/app/Http/Admin/Views/consult/edit.volt b/app/Http/Admin/Views/consult/edit.volt index aac096f7..369d3adf 100644 --- a/app/Http/Admin/Views/consult/edit.volt +++ b/app/Http/Admin/Views/consult/edit.volt @@ -18,6 +18,14 @@
+
+ +
+ + +
+
+
diff --git a/app/Http/Admin/Views/consult/list.volt b/app/Http/Admin/Views/consult/list.volt index bc7ee0bc..dfddee1a 100644 --- a/app/Http/Admin/Views/consult/list.volt +++ b/app/Http/Admin/Views/consult/list.volt @@ -1,3 +1,9 @@ +{%- macro private_info(value) %} + {% if value == 1 %} + + {% endif %} +{%- endmacro %} +
@@ -36,17 +42,17 @@ {% for item in pager.items %} -

课程:{{ item.course.title }}

-

提问:{{ substr(item.question,0,25) }}

+

课程:{{ item.course.title }}{{ private_info(item.private) }}

+

提问:{{ substr(item.question,0,30) }}

{% if item.answer %} -

回复:{{ substr(item.answer,0,25) }}

+

回复:{{ substr(item.answer,0,30) }}

{% endif %}

昵称:{{ item.user.name }}

编号:{{ item.user.id }}

- {{ date('Y-m-d H:i',item.create_time) }} + {{ date('Y-m-d H:i:s',item.create_time) }}
diff --git a/app/Http/Admin/Views/consult/search.volt b/app/Http/Admin/Views/consult/search.volt index 89bea2cc..52cf3633 100644 --- a/app/Http/Admin/Views/consult/search.volt +++ b/app/Http/Admin/Views/consult/search.volt @@ -25,6 +25,14 @@
+
+ +
+ + +
+
+
diff --git a/app/Http/Admin/Views/course/list.volt b/app/Http/Admin/Views/course/list.volt index a333aa1d..f465fba6 100644 --- a/app/Http/Admin/Views/course/list.volt +++ b/app/Http/Admin/Views/course/list.volt @@ -105,6 +105,7 @@
  • 章节管理
  • 学员管理

  • +
  • 咨询管理
  • 评价管理
  • diff --git a/app/Http/Admin/Views/course/search.volt b/app/Http/Admin/Views/course/search.volt index a15b1bb6..5ae683f4 100644 --- a/app/Http/Admin/Views/course/search.volt +++ b/app/Http/Admin/Views/course/search.volt @@ -67,6 +67,14 @@
    +
    + +
    + + +
    +
    +
    diff --git a/app/Http/Admin/Views/order/list.volt b/app/Http/Admin/Views/order/list.volt index d6335c04..d1ac6297 100644 --- a/app/Http/Admin/Views/order/list.volt +++ b/app/Http/Admin/Views/order/list.volt @@ -45,7 +45,7 @@ ¥{{ item.amount }} {{ order_status(item.status) }} - {{ date('Y-m-d H:i',item.create_time) }} + {{ date('Y-m-d H:i:s',item.create_time) }} 详情 diff --git a/app/Http/Admin/Views/order/macro.volt b/app/Http/Admin/Views/order/macro.volt index 836d0d77..e7b73190 100644 --- a/app/Http/Admin/Views/order/macro.volt +++ b/app/Http/Admin/Views/order/macro.volt @@ -4,7 +4,7 @@

    课程名称:{{ course['title'] }}

    市场价格:¥{{ course['market_price'] }},会员价格:¥{{ course['vip_price'] }}

    -

    学习期限:{{ course['study_expiry'] }}个月,退款期限:{{ course['refund_expiry'] }}天

    +

    学习期限:{{ date('Y-m-d H:i:s',course['study_expiry_time']) }},退款期限:{{ date('Y-m-d H:i:s',course['refund_expiry_time']) }}

    {% elseif order.item_type == 'package' %} {% set courses = order.item_info['courses'] %} @@ -12,7 +12,7 @@

    课程名称:{{ course['title'] }}

    市场价格:¥{{ course['market_price'] }},会员价格:¥{{ course['vip_price'] }}

    -

    学习期限:{{ course['study_expiry'] }}个月,退款期限:{{ course['refund_expiry'] }}天

    +

    学习期限:{{ date('Y-m-d H:i:s',course['study_expiry_time']) }},退款期限:{{ date('Y-m-d H:i:s',course['refund_expiry_time']) }}

    {% endfor %} {% elseif order.item_type == 'vip' %} diff --git a/app/Http/Admin/Views/order/order_info.volt b/app/Http/Admin/Views/order/order_info.volt new file mode 100644 index 00000000..fdbe8206 --- /dev/null +++ b/app/Http/Admin/Views/order/order_info.volt @@ -0,0 +1,23 @@ +
    + 订单信息 +
    + + + + + + + + + + + + + + + + + + + +
    订单编号:{{ order.sn }}
    商品信息订单金额订单类型订单状态创建时间
    {{ item_info(order) }}¥{{ order.amount }}{{ item_type(order.item_type) }}{{ order_status(order.status) }}{{ date('Y-m-d H:i:s',order.create_time) }}
    \ No newline at end of file diff --git a/app/Http/Admin/Views/order/show.volt b/app/Http/Admin/Views/order/show.volt index f2195dc2..4cf5341d 100644 --- a/app/Http/Admin/Views/order/show.volt +++ b/app/Http/Admin/Views/order/show.volt @@ -2,36 +2,11 @@ {{ partial('trade/macro') }} {{ partial('refund/macro') }} -
    - 订单信息 -
    - - - - - - - - - - - - - - - - - - - -
    订单编号:{{ order.sn }}
    商品信息订单金额订单类型订单状态创建时间
    {{ item_info(order) }}¥{{ order.amount }}{{ item_type(order.item_type) }}{{ order_status(order.status) }}{{ date('Y-m-d H:i',order.create_time) }}
    +{{ partial('order/order_info') }}
    -
    - {% if order.status == 'pending' %} - - {% endif %} +
    @@ -53,14 +28,13 @@ ¥{{ item.amount }} {{ substr(item.apply_note,0,15) }} {{ refund_status(item) }} - {{ date('Y-m-d H:i',item.create_time) }} + {{ date('Y-m-d H:i:s',item.create_time) }} {% endfor %} +
    {% endif %} -
    - {% if trades.count() > 0 %}
    交易信息 @@ -72,6 +46,7 @@ 交易平台 交易状态 创建时间 + 操作 {% for item in trades %} @@ -79,62 +54,12 @@ ¥{{ item.amount }} {{ channel_type(item.channel) }} {{ trade_status(item.status) }} - {{ date('Y-m-d H:i',item.create_time) }} + {{ date('Y-m-d H:i:s',item.create_time) }} + 详情 {% endfor %} +
    {% endif %} -
    - -
    - 买家信息 -
    - - - - - - - - - - - - - - -
    编号昵称手机邮箱
    {{ user.id }}{{ user.name }}{% if account.phone %} {{ account.phone }} {% else %} 未知 {% endif %}{% if account.email %} {{ account.email }} {% else %} 未知 {% endif %}
    - - \ No newline at end of file +{{ partial('order/user_info') }} \ No newline at end of file diff --git a/app/Http/Admin/Views/order/user_info.volt b/app/Http/Admin/Views/order/user_info.volt new file mode 100644 index 00000000..e5fcfc92 --- /dev/null +++ b/app/Http/Admin/Views/order/user_info.volt @@ -0,0 +1,18 @@ +
    + 用户信息 +
    + + + + + + + + + + + + + + +
    编号昵称手机邮箱
    {{ user.id }}{{ user.name }}{% if account.phone %} {{ account.phone }} {% else %} 未知 {% endif %}{% if account.email %} {{ account.email }} {% else %} 未知 {% endif %}
    \ No newline at end of file diff --git a/app/Http/Admin/Views/refund/list.volt b/app/Http/Admin/Views/refund/list.volt index cd7f05d3..1080564c 100644 --- a/app/Http/Admin/Views/refund/list.volt +++ b/app/Http/Admin/Views/refund/list.volt @@ -45,7 +45,7 @@ ¥{{ item.amount }} {{ refund_status(item) }} - {{ date('Y-m-d H:i',item.create_time) }} + {{ date('Y-m-d H:i:s',item.create_time) }} 详情 diff --git a/app/Http/Admin/Views/refund/show.volt b/app/Http/Admin/Views/refund/show.volt index aa4347aa..c633b624 100644 --- a/app/Http/Admin/Views/refund/show.volt +++ b/app/Http/Admin/Views/refund/show.volt @@ -19,7 +19,7 @@ ¥{{ refund.amount }} {{ substr(refund.apply_note,0,15) }} {{ refund_status(refund) }} - {{ date('Y-m-d H:i',refund.create_time) }} + {{ date('Y-m-d H:i:s',refund.create_time) }} @@ -52,72 +52,19 @@
    {% else %} -
    +
    {% endif %} -
    - 交易信息 -
    +
    - - - - - - - - - - - - - - - -
    交易序号交易金额交易平台交易状态创建时间
    {{ trade.sn }}¥{{ trade.amount }}{{ channel_type(trade.channel) }}{{ trade_status(trade.status) }}{{ date('Y-m-d H:i',trade.create_time) }}
    +{{ partial('trade/trade_info') }}
    -
    - 订单信息 -
    - - - - - - - - - - - - - - - - -
    订单序号商品名称订单金额订单状态创建时间
    {{ order.sn }}{{ order.subject }}¥{{ order.amount }}{{ order_status(order.status) }}{{ date('Y-m-d H:i',order.create_time) }}
    +{{ partial('order/order_info') }}
    -
    - 用户信息 -
    - - - - - - - - - - - - - - -
    编号昵称手机邮箱
    {{ user.id }}{{ user.name }}{% if account.phone %} {{ account.phone }} {% else %} 未知 {% endif %}{% if account.email %} {{ account.email }} {% else %} 未知 {% endif %}
    \ No newline at end of file +{{ partial('order/user_info') }} \ No newline at end of file diff --git a/app/Http/Admin/Views/review/list.volt b/app/Http/Admin/Views/review/list.volt index 9efbb1b3..aaa0619c 100644 --- a/app/Http/Admin/Views/review/list.volt +++ b/app/Http/Admin/Views/review/list.volt @@ -38,13 +38,13 @@

    评分:{{ item.rating }}

    课程:{{ item.course.title }}

    -

    评价:{{ substr(item.content,0,25) }}

    +

    评价:{{ substr(item.content,0,30) }}

    昵称:{{ item.user.name }}

    编号:{{ item.user.id }}

    - {{ date('Y-m-d H:i',item.create_time) }} + {{ date('Y-m-d H:i:s',item.create_time) }}
    diff --git a/app/Http/Admin/Views/student/list.volt b/app/Http/Admin/Views/student/list.volt index b5ff839d..19e2c735 100644 --- a/app/Http/Admin/Views/student/list.volt +++ b/app/Http/Admin/Views/student/list.volt @@ -64,8 +64,8 @@ {{ source_type_info(item.source_type) }} -

    开始:{{ date('Y-m-d H:i',item.create_time) }}

    -

    结束:{{ date('Y-m-d H:i',item.expiry_time) }}

    +

    开始:{{ date('Y-m-d H:i:s',item.create_time) }}

    +

    结束:{{ date('Y-m-d H:i:s',item.expiry_time) }}

    diff --git a/app/Http/Admin/Views/trade/list.volt b/app/Http/Admin/Views/trade/list.volt index fbca7d1a..514159f4 100644 --- a/app/Http/Admin/Views/trade/list.volt +++ b/app/Http/Admin/Views/trade/list.volt @@ -48,7 +48,7 @@ ¥{{ item.amount }} {{ channel_type(item.channel) }} {{ trade_status(item.status) }} - {{ date('Y-m-d H:i',item.create_time) }} + {{ date('Y-m-d H:i:s',item.create_time) }} 详情 diff --git a/app/Http/Admin/Views/trade/show.volt b/app/Http/Admin/Views/trade/show.volt index 933842d8..d2150af9 100644 --- a/app/Http/Admin/Views/trade/show.volt +++ b/app/Http/Admin/Views/trade/show.volt @@ -2,33 +2,11 @@ {{ partial('trade/macro') }} {{ partial('refund/macro') }} -
    - 交易信息 -
    - - - - - - - - - - - - - - - - -
    交易序号交易金额交易平台交易状态创建时间
    {{ trade.sn }}¥{{ trade.amount }}{{ channel_type(trade.channel) }}{{ trade_status(trade.status) }}{{ date('Y-m-d H:i',trade.create_time) }}
    +{{ partial('trade/trade_info') }}
    -
    - {% if trade.status == 'pending' %} - - {% endif %} +
    {% if trade.status == 'finished' %} {% endif %} @@ -53,7 +31,7 @@ ¥{{ item.amount }} {{ substr(item.apply_note,0,15) }} {{ refund_status(item) }} - {{ date('Y-m-d H:i',item.create_time) }} + {{ date('Y-m-d H:i:s',item.create_time) }} {% endfor %} @@ -61,47 +39,11 @@
    -
    - 订单信息 -
    - - - - - - - - - - - - - - - - -
    订单序号商品名称订单金额订单状态创建时间
    {{ order.sn }}{{ order.subject }}¥{{ order.amount }}{{ order_status(order.status) }}{{ date('Y-m-d H:i',order.create_time) }}
    +{{ partial('order/order_info') }}
    -
    - 用户信息 -
    - - - - - - - - - - - - - - -
    编号昵称手机邮箱
    {{ user.id }}{{ user.name }}{% if account.phone %} {{ account.phone }} {% else %} 未知 {% endif %}{% if account.email %} {{ account.email }} {% else %} 未知 {% endif %}
    +{{ partial('order/user_info') }}