问题修复

main
limu 12 months ago
parent ba048e8e33
commit 1a9a6e8f3a
  1. 28
      app/command/dayValue.php
  2. 3
      app/controller/admin/system/admin/Partner.php

@ -35,7 +35,35 @@ class dayValue extends Command
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
$currentDate = date('Y-m-01'); // 获取当前月的第一天
//判断当月第一天
if (date('Y-m-d') === $currentDate) {
//获取上个月时间
list($start, $end) = $this->getLastMonth();
//根据社区等级分配贡献值
//重置社区等级
}
}
public function getLastMonth()
{
// 获取当前日期
$currentDate = date('Y-m-d');
// 提取当前日期的年、月和日
$currentYear = date('Y', strtotime($currentDate));
$currentMonth = date('m', strtotime($currentDate));
// 计算上个月的年份和月份
$lastMonthYear = $currentYear - 1;
$lastMonth = $currentMonth - 1;
// 处理特殊情况:如果上个月的月份小于1,则年份减1,月份设为12
if ($lastMonth < 1) {
$lastMonthYear--;
$lastMonth = 12;
}
// 获取上个月的第一天和最后一天
$firstDayOfLastMonth = date('Y-m-01', strtotime("$lastMonthYear-$lastMonth-01"));
$lastDayOfLastMonth = date('Y-m-t', strtotime("$lastMonthYear-$lastMonth-01"));
return [$firstDayOfLastMonth, $lastDayOfLastMonth];
} }

@ -63,8 +63,9 @@ class Partner extends BaseController
public function update(PartnerRoleValidate $validate) public function update(PartnerRoleValidate $validate)
{ {
$data = $this->request->params(['name', 'ratio', 'is_area', 'area_level', $data = $this->request->params(['name', 'ratio', 'is_area', 'area_level',
'area_id', ['status', 1], ['type', 1], ['max_role_num', 0], 'brand_id', 'trade_id']); 'area_id', ['status', 1], ['type', 1], ['max_role_num', 0], 'brand_id', 'trade_id','id']);
$validate->check($data); $validate->check($data);
if ($data['is_area'] == 1) { if ($data['is_area'] == 1) {

Loading…
Cancel
Save