|
|
@@ -391,9 +391,22 @@ class MemberService extends BaseService
|
|
|
$parents[] = $parentId;
|
|
|
$parents = ','.implode(',', $parents).',';
|
|
|
|
|
|
+ // 滑落节点
|
|
|
+ $pointId = 0;
|
|
|
+ $points = '';
|
|
|
+ if($parentId>0){
|
|
|
+ $pointId = $this->getPointParentId($parentId);
|
|
|
+ if($pointId){
|
|
|
+ $pointParent = $this->model->where(['id'=> $pointId,'mark'=>1])->select(['id','points'])->first();
|
|
|
+ $points = isset($pointParent['points']) && $pointParent['points']? $pointParent['points'].$pointId.',' : ($pointId ? $pointId . ',' : '');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
DB::beginTransaction();
|
|
|
$info->parent_id = $parentId;
|
|
|
$info->parents = $parents;
|
|
|
+ $info->point_id = $pointId;
|
|
|
+ $info->points = $points;
|
|
|
$info->update_time = time();
|
|
|
if(!$info->save()){
|
|
|
DB::rollBack();
|
|
|
@@ -404,7 +417,14 @@ class MemberService extends BaseService
|
|
|
// 修改下级推荐参数
|
|
|
if($this->model->where(['parent_id'=> $id])->count('id') && !$this->model->where(['parent_id'=> $id])->update(['parents'=> $parents.$id.',','update_time'=>time()])){
|
|
|
DB::rollBack();
|
|
|
- $this->error = '修改下级数据失败';
|
|
|
+ $this->error = '修改下级推荐数据失败';
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 修改下级节点参数
|
|
|
+ if($this->model->where(['point_id'=> $id])->count('id') && !$this->model->where(['point_id'=> $id])->update(['points'=> $points.$id.',','update_time'=>time()])){
|
|
|
+ DB::rollBack();
|
|
|
+ $this->error = '修改下级节点数据失败';
|
|
|
return false;
|
|
|
}
|
|
|
|