generated from liutk/owl-admin-base
merge
commit
d24fc3065a
|
|
@ -44,7 +44,7 @@ class AgreementController extends AdminController
|
|||
->placeholder(__('employee.name').'/'.__('employee.phone'))
|
||||
->columnRatio(3)
|
||||
->clearable(),
|
||||
amis()->SelectControl()->name('check_status')->label(__('workflow_log.check_status'))->options(CheckStatus::options())->columnRatio(3)->clearable(),
|
||||
amis()->SelectControl()->name('check_status')->label(__('workflow_log.check_status'))->options(Arr::except(CheckStatus::options(), [CheckStatus::Cancel->value]))->columnRatio(3)->clearable(),
|
||||
amisMake()->DateRangeControl()
|
||||
->name('date_range')
|
||||
->label(__('agreement.created_at'))
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use App\Admin\Controllers\AdminController;
|
|||
use App\Admin\Services\Finance\StoreMasterCommissionService;
|
||||
use App\Enums\CheckStatus;
|
||||
use App\Traits\HasCheckActions;
|
||||
use Illuminate\Support\Arr;
|
||||
use Slowlyo\OwlAdmin\Admin;
|
||||
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||
|
|
@ -41,7 +42,7 @@ class StoreMasterCommissionController extends AdminController
|
|||
->clearable(),
|
||||
amis()->SelectControl()->name('check_status')->label(__('workflow_log.check_status'))
|
||||
->multiple()
|
||||
->options(CheckStatus::options())
|
||||
->options(Arr::except(CheckStatus::options(), [CheckStatus::Cancel->value]))
|
||||
->clearable(),
|
||||
]),
|
||||
]))
|
||||
|
|
|
|||
|
|
@ -8,16 +8,19 @@ use App\Admin\Services\BaseService;
|
|||
use App\Enums\PlanStatus;
|
||||
use App\Enums\TaskStatus;
|
||||
use App\Models\Keyword;
|
||||
use App\Models\Ledger;
|
||||
use App\Models\Plan;
|
||||
use App\Models\PlanHygiene;
|
||||
use App\Models\PlanPerformance;
|
||||
use App\Models\Store;
|
||||
use App\Models\Task;
|
||||
use App\Models\TaskHygiene;
|
||||
use App\Models\TaskPerformance;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
|
|
@ -215,6 +218,12 @@ class PlanService extends BaseService
|
|||
'level_id' => $plan->planable->store_level_id,
|
||||
];
|
||||
|
||||
$aggregates = Ledger::select(['store_id', DB::raw('SUM(`sales`) as sales')])
|
||||
->whereBetween('date', [$startAt->format('Y-m-d'), $endAt->format('Y-m-d')])
|
||||
->groupBy('store_id')
|
||||
->pluck('sales', 'store_id')
|
||||
->toArray();
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Collection */
|
||||
$stores = Store::filter($input, StoreFilter::class)->get(['id', 'master_id']);
|
||||
|
||||
|
|
@ -224,15 +233,23 @@ class PlanService extends BaseService
|
|||
'store_id' => $store->id,
|
||||
'store_master_id' => $store->master_id,
|
||||
'expected_performance' => $plan->planable->performance,
|
||||
'actual_performance' => 0,
|
||||
'actual_performance' => $aggregates[$store->id] ?? 0,
|
||||
]);
|
||||
$taskable->task()->create([
|
||||
|
||||
$task = new Task([
|
||||
'plan_id' => $plan->id,
|
||||
'name' => '业绩指标',
|
||||
'start_at' => $startAt,
|
||||
'end_at' => $endAt,
|
||||
'task_status' => TaskStatus::Pending,
|
||||
]);
|
||||
|
||||
if ($taskable->isSuccess()) {
|
||||
$task->task_status = TaskStatus::Success;
|
||||
$task->completed_at = now();
|
||||
}
|
||||
|
||||
$taskable->task()->save($task);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class SendWorkflowCheckFailedNotification implements ShouldQueue
|
|||
},
|
||||
'template' => function($gateway) {
|
||||
if ($gateway->getName() == 'aliyun') {
|
||||
return 'SMS_465890235';
|
||||
return 'SMS_465905330';
|
||||
}
|
||||
},
|
||||
'data' => function($gateway) use ($applyAt, $subjectTypeText) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class SendWorkflowCheckNextNotification implements ShouldQueue
|
|||
},
|
||||
'template' => function($gateway) {
|
||||
if ($gateway->getName() == 'aliyun') {
|
||||
return 'SMS_465885234';
|
||||
return 'SMS_465900349';
|
||||
}
|
||||
},
|
||||
'data' => function($gateway) use ($subjectTypeText) {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class SendWorkflowCheckSuccessNotification implements ShouldQueue
|
|||
},
|
||||
'template' => function($gateway) {
|
||||
if ($gateway->getName() == 'aliyun') {
|
||||
return 'SMS_465915258';
|
||||
return 'SMS_465955319';
|
||||
}
|
||||
},
|
||||
'data' => function($gateway) use ($applyAt, $subjectTypeText) {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,7 @@ return [
|
|||
'strategy' => \Overtrue\EasySms\Strategies\OrderStrategy::class,
|
||||
|
||||
// 默认可用的发送网关
|
||||
'gateways' => [
|
||||
'aliyun',
|
||||
],
|
||||
'gateways' => explode(',', env('EASYSMS_GATEWAYS', 'errorlog')),
|
||||
],
|
||||
// 可用的网关配置
|
||||
'gateways' => [
|
||||
|
|
|
|||
Loading…
Reference in New Issue