blacklist) { return [ 'code' => 1, 'msg' => '无法下单' ]; } if (isset($other['mobile']) && $other['mobile']) { if (!preg_match("/^1\d{10}$/", $other['mobile'])) { return [ 'code' => 1, 'msg' => '请输入正确的手机号111' ]; } } } /** * 分销 保存上级的ID(用于先成为上下级,再成为分销商) * @param $parentId * @return static */ public static function saveParentId($parentId) { if (!$parentId) { return; } // 父级用户不存在 $parentUser = User::findOne($parentId); if (!$parentUser) { return; } $user = get_user(); if ($user) { $form = new BindForm(); $form->store_id = get_store_id(); $form->user_id = get_user_id(); $form->parent_id = $parentId; $form->condition = 1; $form->save(); // $user->parent_user_id = $parentId; // $user->save(); } return $user; } }