6
0
Fork 0

添加商家端消息发送

release
vine_liutk 2022-01-05 11:39:02 +08:00
parent 0c4781012a
commit c54f16f515
8 changed files with 17 additions and 10 deletions

View File

@ -119,6 +119,7 @@ class UserController extends AdminController
$grid->filter(function (Grid\Filter $filter) {
$filter->panel();
$filter->like('phone')->width(3);
$filter->like('userInfo.nickname')->width(3);
$filter->equal('userInfo.agent_level')->select(UserInfo::$agentLevelTexts)->width(3);
$filter->between('created_at')->dateTime()->width(7);
// $filter->between('userInfo.growth_value')->width(6);

View File

@ -39,9 +39,9 @@ class Unipush extends Form
$this->switch('is_use', '是否启用')->value($appSettings['is_use'] ?? 0);
$this->text('mall_app_id', '商城APP_ID')->value($appSettings['mall_app_id'] ?? '');
$this->text('mall_app_key', '商城APP_KEY')->value($appSettings['mall_app_id'] ?? '');
$this->text('mall_app_secret', '商城APP_SECRET')->value($appSettings['mall_app_id'] ?? '');
$this->text('mall_master_secret', '商城APP_MASTER_SECRET')->value($appSettings['mall_app_id'] ?? '');
$this->text('mall_app_key', '商城APP_KEY')->value($appSettings['mall_app_key'] ?? '');
$this->text('mall_app_secret', '商城APP_SECRET')->value($appSettings['mall_app_secret'] ?? '');
$this->text('mall_master_secret', '商城APP_MASTER_SECRET')->value($appSettings['mall_master_secret'] ?? '');
$this->divider();
$this->switch('merchant_is_use', '是否启用')->value($appSettings['merchant_is_use'] ?? 0);

View File

@ -56,6 +56,8 @@ class PreIncomeJobCommand extends Command
]);
}
}
//发送商家端预收益进帐消息
try {
DB::beginTransaction();
switch (get_class($job->jobable)) {

View File

@ -47,7 +47,7 @@ class PushMessageCommand extends Command
$status = $mallPushService->push($task->sn, $task->message) ? 1 : 2;
}
} elseif ($task->message instanceof MerchantMessage) {
if ((bool) app_settings('unipush.is_use')) {//如果开启了推送
if ((bool) app_settings('unipush.merchant_is_use')) {//如果开启了推送
$status = $merchantPushService->push($task->sn, $task->message) ? 1 : 2;
}
}

View File

@ -1,7 +1,8 @@
<?php
namespace App\Endpoint\Api\Http\Controllers;
namespace App\Endpoint\Api\Http\Controllers\Merchant;
use App\Endpoint\Api\Http\Controllers\Controller;
use App\Endpoint\Api\Http\Resources\Merchant\MessageResource;
use App\Helpers\Paginator as PaginatorHelper;
use App\Models\MerchantMessage as Message;

View File

@ -200,5 +200,7 @@ Route::group([
Route::get('agent-upgrade-conditions', [Merchant\AgentController::class, 'upgradeConditions']);
// 代理统计
Route::get('agent-statistics', [Merchant\AgentController::class, 'statistics']);
// 消息列表
Route::get('messages', [Merchant\MessageController::class, 'index']);
});
});

View File

@ -2,6 +2,7 @@
namespace App\Models;
use App\Casts\JsonArray;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

View File

@ -89,11 +89,11 @@ class AppSettingSeeder extends Seeder
'mall_app_key' => 'JX33P0wP8bAQprI953hpN6',
'mall_app_secret' => 'a3u3B6lXjq6fPTBlOGiOc9',
'mall_master_secret' => 'MAxmqomwo597xJeDuMCvx1',
'merchant_is_use' => false,
'merchant_app_id' => '',
'merchant_app_key' => '',
'merchant_app_secret' => '',
'merchant_master_secret' => '',
'merchant_is_use' => true,
'merchant_app_id' => '5bvlKxO8RK7lCTc9DINcx5',
'merchant_app_key' => 'qrPLowCchvArbpMKoPlMV1',
'merchant_app_secret' => '5k36Jo49EAAGBDvR0cFqG3',
'merchant_master_secret' => 'HCB87uFoF18iWsKHf7VY57',
],
'remarks' => '个推配置',
],