|
@@ -9,7 +9,9 @@ use App\Libs\Utils;
|
|
|
use App\Modules\Activity\Services\ActivityService;
|
|
|
use App\Modules\Channel\Services\ChannelService;
|
|
|
use App\Modules\Product\Services\ProductService;
|
|
|
+use App\Modules\SendOrder\Models\QuickAppSendOrder;
|
|
|
use App\Modules\Subscribe\Services\OrderService;
|
|
|
+use App\Modules\User\Models\QappChannelAccount;
|
|
|
use Illuminate\Http\Request;
|
|
|
use App\Http\Controllers\QuickApp\BaseController;
|
|
|
use Redis;
|
|
@@ -195,12 +197,21 @@ class ActivityController extends BaseController
|
|
|
$channelId = (int)$this->distribution_channel_id;
|
|
|
$activity = ActivityService::getByToken($token);
|
|
|
$activityId = getProp($activity, 'id');
|
|
|
-
|
|
|
- if (!$activityId || !getProp($activity, 'setting') || (int)getProp($activity, 'create_type') !== 5
|
|
|
- || (int)getProp($activity, 'distribution_channel_id') !== $channelId) {
|
|
|
+ if (!$activityId || !getProp($activity, 'setting') || (int)getProp($activity, 'create_type') !== 5) {
|
|
|
Utils::throwError(ErrorConst::ACTIVITY_NOT_FOUND);
|
|
|
}
|
|
|
|
|
|
+ // 用户派单的信息是否跟创建该活动的子账号一致
|
|
|
+ $sendOrderId = $this->send_order_id;
|
|
|
+ $qappAccountId = (int)getProp($activity, 'qapp_account_id');
|
|
|
+ if ($qappAccountId) {
|
|
|
+ $sendOrder = QuickAppSendOrder::getSendOrderById($sendOrderId);
|
|
|
+ $qappAccount = QappChannelAccount::getByAccount(getProp($sendOrder, 'account'));
|
|
|
+ if ($qappAccountId !== (int)getProp($qappAccount, 'id')) {
|
|
|
+ Utils::throwError(ErrorConst::ACTIVITY_INVALID);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 活动开始时间判断
|
|
|
if (getProp($activity, 'start_time') > date('Y-m-d H:i:s')) {
|
|
|
Utils::throwError(ErrorConst::ACTIVITY_NOT_START);
|