1748153932 12 months ago
parent 56c582d8c7
commit cab271edfb
  1. 62
      app/command/brand.php
  2. 10
      app/common/repositories/user/UserRepository.php
  3. 12
      app/controller/admin/user/User.php
  4. 4
      app/controller/api/user/User.php
  5. 2
      config/console.php

@ -0,0 +1,62 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
declare (strict_types=1);
namespace app\command;
use Swoole\Coroutine\MySQL\Exception;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\event\RouteLoaded;
use think\facade\Cache;
use think\facade\Route;
use app\common\repositories\system\auth\MenuRepository;
// /www/server/php/74/bin/php /server/wwwroot/crmeb/think brand
class brand extends Command
{
protected function configure()
{
// 指令配置
$this->setName('clearCache')
->addArgument('cacheType',Argument::OPTIONAL, 'php think menu [1] / [2]')
->setDescription('各种积分转换');
}
/**
* TODO
* @param Input $input
* @param Output $output
* @return int|void|null
* @author Qinii
* @day 4/24/22
*/
protected function execute(Input $input, Output $output)
{
echo env('brand.brand_integral', '222');die;
}
}

@ -128,6 +128,16 @@ class UserRepository extends BaseRepository
Elm::input('uid', '用户 ID', '')->disabled(true)->required(true),
Elm::input('real_name', '真实姓名'),
Elm::input('phone', '手机号'),
Elm::input('brand_integral', '品宣贡积分'),
Elm::input('brand_value', '品宣贡献值'),
Elm::input('role_value', '角色贡献值'),
Elm::input('community_value', '社区贡献值'),
// Elm::input('all_value', '总贡献值', '')->disabled(true)->required(true),
Elm::input('brand_add', '增值积分'),
Elm::input('super_days', '自动转换超级积分的累加天数', '')->disabled(true)->required(true),
Elm::date('birthday', '生日'),
Elm::input('card_id', '身份证'),
Elm::input('addres', '用户地址'),

@ -197,7 +197,16 @@ class User extends BaseController
*/
public function update($id, UserValidate $validate, UserLabelRepository $labelRepository, UserGroupRepository $groupRepository)
{
$data = $this->request->params(['real_name', 'phone', 'birthday', 'card_id', 'addres', 'mark', 'group_id', ['label_id', []], ['is_promoter', 0], ['status', 0]]);
$data = $this->request->params(['real_name', 'phone','role_value',
'brand_value',
'brand_integral',
'role_value',
'community_value',
'super_days',
'brand_add',
'birthday', 'card_id', 'addres', 'mark', 'group_id', ['label_id', []], ['is_promoter', 0], ['status', 0]]);
$validate->check($data);
if (!$this->repository->exists($id))
return app('json')->fail('数据不存在');
@ -213,6 +222,7 @@ class User extends BaseController
if ($data['is_promoter'])
$data['promoter_time'] = date('Y-m-d H:i:s');
if(!$data['birthday']) unset($data['birthday']);
$this->repository->update($id, $data);
return app('json')->success('编辑成功');

@ -24,6 +24,7 @@ use app\common\repositories\user\UserRepository;
use app\common\repositories\user\UserVisitRepository;
use app\validate\api\UserBaseInfoValidate;
use crmeb\basic\BaseController;
use app\common\model\user\User as userModel;
use crmeb\services\MiniProgramService;
use crmeb\services\SmsService;
use think\App;
@ -321,6 +322,9 @@ class User extends BaseController
//分享视频/推文增加品宣积分
public function brand()
{
$model = userModel::getDB();
$query = $model->where('uid', 1)->find()->toArray();
var_dump($query);die;
$user = $this->user->uid;
$type = $this->request->param('type');

@ -37,5 +37,7 @@ return [
'clear:cache' => 'app\command\clearCache',
//更新热卖榜单
'change:hotTop' => 'app\command\changeHotTop',
//各种积分转换
'brand' => 'app\command\brand',
],
];

Loading…
Cancel
Save