user_id = $userId; $shareModel->type = $type; $shareModel->interest_ids = $ids; $result = $shareModel->save(); return $result ? $shareModel->id : 0; } /** * 获取分享基础信息 * */ public static function getShareInfo($userId, $shareId) { return self::select('id', 'type', 'interest_ids') ->where('enable', 1)->where('user_id', $userId) ->where('id', $shareId)->first(); } }