Compare commits

..

2 Commits

Author SHA1 Message Date
ztt d269d35d24 1 8 months ago
ztt 526e08cbd4 添加优惠券领取状态和用户登录逻辑修改 8 months ago
  1. 7
      addons/shopro/controller/Index.php
  2. 3
      addons/shopro/controller/user/WalletLog.php
  3. 34
      addons/shopro/service/CommissionScoreLog.php
  4. 9
      addons/shopro/service/commission/Agent.php
  5. 2
      addons/shopro/service/order/OrderCreate.php

@ -4,6 +4,7 @@ namespace addons\shopro\controller;
use addons\shopro\controller\traits\Util; use addons\shopro\controller\traits\Util;
use addons\shopro\library\easywechatPlus\WechatMiniProgramShop; use addons\shopro\library\easywechatPlus\WechatMiniProgramShop;
use addons\shopro\service\user\UserAuth;
use app\admin\model\shopro\decorate\Decorate; use app\admin\model\shopro\decorate\Decorate;
use app\admin\model\shopro\decorate\Page; use app\admin\model\shopro\decorate\Page;
use app\common\library\Sms as Smslib; use app\common\library\Sms as Smslib;
@ -171,8 +172,10 @@ class Index extends Common
//被占用 //被占用
$this->error(__('手机号已经被占用')); $this->error(__('手机号已经被占用'));
} elseif (in_array($event, ['changepwd', 'resetpwd', 'mobilelogin']) && !$userinfo) { } elseif (in_array($event, ['changepwd', 'resetpwd', 'mobilelogin']) && !$userinfo) {
//未注册 //未注册 注册手机号
$this->error(__('手机号未注册')); $this->auth->register($mobile, $mobile, '', $mobile, '');
// set_token_in_header($auth->getToken());
// $this->error(__('手机号未注册'));
} }
} }
if (!Hook::get('sms_send')) { if (!Hook::get('sms_send')) {

@ -71,7 +71,8 @@ class WalletLog extends Common
$user = auth_user(); $user = auth_user();
$user_id = $user->id; $user_id = $user->id;
if (!Sms::check($params['exchange_phone'], $params['code'], 'mobilelogin')) {
if (!Sms::check($params['exchange_phone'], $params['code'], 'score')) {
$this->error('验证码不正确'); $this->error('验证码不正确');
} }
$exchange_user = UserModel::getByMobile($params['exchange_phone']); $exchange_user = UserModel::getByMobile($params['exchange_phone']);

@ -0,0 +1,34 @@
<?php
namespace addons\shopro\service;
use app\admin\model\User;
use app\admin\model\shopro\commission\Level as LevelModel;
use app\admin\model\shopro\user\WalletLog as WalletLogModel;
class CommissionScoreLog
{
public $user = null;
public function __construct($user = null)
{
$this->user = is_numeric($user) ? User::get($user) : $user;
$this->user = $this->user ?: auth_user();
}
/**
* 计算用户积分
* @return
*/
public function addLog() {
}
/**
* 获取用户等级
*/
public function getUserLevel() {
}
}

@ -538,4 +538,13 @@ class Agent
// 循环完所有的 如果是①的情况则代表都不符合条件,如果是②则代表都符合条件 返回对应状态即可 // 循环完所有的 如果是①的情况则代表都不符合条件,如果是②则代表都符合条件 返回对应状态即可
return boolval($level->upgrade_type); return boolval($level->upgrade_type);
} }
/**
* 计算分销用户用户积分
* @return
*/
public function calcScore() {
$comission_score = 0;
}
} }

@ -614,7 +614,7 @@ class OrderCreate
* *
* @return array * @return array
*/ */
public function getCoupons($calc_type = 'coupons') public function xgetCoupons($calc_type = 'coupons')
{ {
$this->calc_type = $calc_type; $this->calc_type = $calc_type;
// 检查是否可下单 // 检查是否可下单

Loading…
Cancel
Save