1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-23 20:00:27 +08:00

1.修正问题分类列表查询条件

2.发货增加noMatchedHandler
This commit is contained in:
koogua 2022-07-07 16:28:17 +08:00
parent d1917781fb
commit 34da1deae6
4 changed files with 17 additions and 5 deletions

View File

@ -1,3 +1,7 @@
### [v1.5.5](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.5)(2022-07-15)
- 修正获分类查询条件
### [v1.5.4](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.4)(2022-06-15)
- 增加migration助手SettingTrait

View File

@ -23,15 +23,15 @@ class QuestionList extends Builder
return $questions;
}
public function handleCategories(array $articles)
public function handleCategories(array $questions)
{
$categories = $this->getCategories();
foreach ($articles as $key => $article) {
$articles[$key]['category'] = $categories[$article['category_id']] ?? new \stdClass();
foreach ($questions as $key => $article) {
$questions[$key]['category'] = $categories[$article['category_id']] ?? new \stdClass();
}
return $articles;
return $questions;
}
public function handleUsers(array $questions)

View File

@ -58,6 +58,9 @@ class DeliverTask extends Task
case OrderModel::ITEM_VIP:
$this->handleVipOrder($order);
break;
default:
$this->noMatchedHandler($order);
break;
}
$order->status = OrderModel::STATUS_FINISHED;
@ -153,6 +156,11 @@ class DeliverTask extends Task
$this->closePendingOrders($user->id);
}
protected function noMatchedHandler(OrderModel $order)
{
throw new \RuntimeException("No Matched Handler For Order: {$order->id}");
}
protected function closePendingOrders($userId)
{
$orders = $this->findUserPendingOrders($userId);

View File

@ -46,7 +46,7 @@ class Question extends Service
$categoryRepo = new CategoryRepo();
return $categoryRepo->findAll([
'type' => CategoryModel::TYPE_ARTICLE,
'type' => CategoryModel::TYPE_QUESTION,
'level' => 1,
'published' => 1,
'deleted' => 0,