修复:成为经销商未赠送画
This commit is contained in:
parent
0973536e64
commit
14a1d1206a
|
|
@ -142,7 +142,7 @@ class WeightValue extends BaseModel{
|
|||
$agents = [];
|
||||
foreach($parents as $memberInfo){
|
||||
$teamDividendInfo = $teamDividend[$memberInfo['parent_id']] ?? [];
|
||||
if($teamDividendInfo) $teamDividendInfo['ranking'] = $allTeamDividend[$memberInfo['parent_id']];
|
||||
if($teamDividendInfo) $teamDividendInfo['ranking'] = ((int)$allTeamDividend[$memberInfo['parent_id']] + 1);
|
||||
|
||||
$agents[] = [
|
||||
'uid' => $memberInfo['parent_id'],
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
$config = array();
|
||||
|
||||
$config['db']['master']['host'] = '127.0.0.1';
|
||||
$config['db']['master']['username'] = 'bztang_cdlfjy_co';
|
||||
$config['db']['master']['password'] = 'aRFkTGY5mbcY7A8Y';
|
||||
$config['db']['master']['username'] = 'testbzt_cdlfjy_c';
|
||||
$config['db']['master']['password'] = 'CTyRGMfzarFtspbC';
|
||||
$config['db']['master']['port'] = '3306';
|
||||
$config['db']['master']['database'] = 'bztang_cdlfjy_co';
|
||||
$config['db']['master']['database'] = 'testbzt_cdlfjy_c';
|
||||
$config['db']['master']['tablepre'] = 'ims_';
|
||||
|
||||
$config['db']['slave_status'] = false;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ use app\common\components\BaseController;
|
|||
use app\common\facades\Setting;
|
||||
use app\common\helpers\PaginationHelper;
|
||||
use app\common\helpers\Url;
|
||||
use app\common\models\Order;
|
||||
use app\common\models\weightValue\WeightValue;
|
||||
use Yunshop\CollectionRoom\models\CollectionRoomModel;
|
||||
|
||||
class IndexController extends BaseController{
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ class CollectionRoomModel extends BaseModel{
|
|||
// 条件生成
|
||||
$where = [];
|
||||
if($search['member_id'] > 0) $where[] = ['member_id','=',$search['member_id']];
|
||||
if($search['unique_number'] > 0) $where[] = ['unique_number','=',$search['unique_number']];
|
||||
// 列表获取
|
||||
$model = self::uniacid()
|
||||
->select($field)
|
||||
|
|
@ -71,6 +72,7 @@ class CollectionRoomModel extends BaseModel{
|
|||
public static function addInfo($memberId){
|
||||
// 判断:当前用户是否已经持有 未持有赠送 持有则不管
|
||||
$isHas = (int)self::uniacid()->where('member_id',$memberId)->value('id');
|
||||
\Log::debug('给指定用户添加一幅画 - 查询结果 - 典藏室id:',$isHas);
|
||||
if($isHas <= 0){
|
||||
self::insert([
|
||||
'uniacid' => \YunShop::app()->uniacid,
|
||||
|
|
@ -78,6 +80,8 @@ class CollectionRoomModel extends BaseModel{
|
|||
'created_at' => time()
|
||||
]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -46,17 +46,19 @@
|
|||
<div class="col-sm-11 col-xs-12">
|
||||
<div class="row row-fix tpl-category-container" >
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[uid]" id="" type="text" value="{{ $search['uid'] }}" placeholder="用户ID">
|
||||
<input class="form-control" name="search[member_id]" id="" type="text" value="{{ $search['member_id'] }}" placeholder="用户ID">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[nickname]" id="" type="text" value="{{ $search['nickname'] }}" placeholder="用户昵称|真实姓名">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[unique_number]" id="" type="text" value="{{ $search['unique_number'] }}" placeholder="唯一编号">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-6">
|
||||
<button type="button" class="btn btn-primary" onclick="addStoreManager()"><i class="fa fa-plus"></i> 添加</button>
|
||||
<button class="btn btn-success" id="search"><i class="fa fa-search"></i> 搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use Illuminate\Queue\SerializesModels;
|
|||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
use Illuminate\Support\Str;
|
||||
use Yunshop\CollectionRoom\models\CollectionRoomModel;
|
||||
use Yunshop\Love\Common\Services\LoveChangeService;
|
||||
use Yunshop\TeamDividend\models\Log;
|
||||
use Yunshop\TeamDividend\models\TeamDividendAgencyModel;
|
||||
|
|
@ -507,5 +508,7 @@ class NewUpgrateJob implements ShouldQueue
|
|||
'relation' => $member->yzMember->relation,
|
||||
'upgrade_at' => time(),
|
||||
]);
|
||||
// 会员升级经销商 赠送一幅画
|
||||
CollectionRoomModel::addInfo($member->uid);
|
||||
}
|
||||
}
|
||||
|
|
@ -13,15 +13,17 @@ use Yunshop\TeamDividend\models\TeamDividendAgencyModel;
|
|||
class DealerObserver extends BaseObserver
|
||||
{
|
||||
|
||||
public function saving(Model $model){
|
||||
\Log::debug('新增经销商',$model->uid);
|
||||
if($model->uid > 0){
|
||||
|
||||
public function created(Model $model){
|
||||
\Log::debug('新增经销商 - created - 用户uid:',$model->toArray());
|
||||
if((int)$model->uid > 0){
|
||||
// 会员升级经销商 赠送一幅画
|
||||
CollectionRoomModel::addInfo($model->uid);
|
||||
CollectionRoomModel::addInfo((int)$model->uid);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function updating(Model $model)
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue