Laravel where 和 join 时使用find_in_set()

5 篇文章 1 订阅
3 篇文章 0 订阅
  • join时使用find_in_set()
$fields = ['tagId', DB::raw('GROUP_CONCAT(cp.name) as className')];
Tag::select($fields)
	->leftJoin('mg_class_public as cp',function ($join) {
        $join->whereRaw(DB::raw('FIND_IN_SET(cp.id, mg_tag.class_ids)'));
     })
     ->get()
     ->toArray();
  • select 是使用find_in_set()
User::where('userId', $this->userId)
    ->whereRaw(DB::raw("FIND_IN_SET({$routerId}, router)"))
	->value('router');
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
7.1.4 29-Sep-17 InterBase data provider Bug with the "Input parameter mismatch" error for procedure is fixed Bug with transactions when working with Firebird 2.5 is fixed 7.1.3 19-Sep-17 The performance of TVirtualQuery is significantly improved Application-defined functions in TVirtualQuery are supported Application-defined collations in TVirtualQuery are supported AutoInc fields in TVirtualTable are supported Bug with assertion failure when updating a record in TVirtualQuery is fixed Bug with compatibility with TkbmMemTable in TVirtualQuery is fixed Bug with complex WHERE clauses that have several string fields in TVirtualQuery is fixed Bug with selecting from a dataset with a single record in TVirtualQuery is fixed Bug with generating SQL for batch updates is fixed Bug with the Locate method for non-Windows platforms in Lazarus is fixed Bug with the FindFirst, FindLast, FindNext, FindPrior methods in Lazarus is fixed Bug with accessing a product help from the IDE menu is fixed Bug with recreating fields when calling Open after Prepare is fixed Bug with an incorrect error message when using the Connect dialog component on mobile platforms is fixed Bug with AV failure when using calculated fields in TClientDataset is fixed Bug with a key violation error when executing batch operations is fixed Bug with Assert when calling the Locate method in the SmartFetch mode is fixed Bug with using DAC components in DataModule for Linux is fixed Cloud data providers BigCommerce provider is added Dynamics CRM provider is added FreshBooks provider is added Magento provider is added MailChimp provider is added NetSuite provider is added QuickBooks provider is added Salesforce provider is added Salesforce Marketing Cloud provider is added SugarCRM provider is added Zoho CRM provider is added Oracle data provider Oracle 12c connection modes (SYSBACKUP, SYSDG, SYSKM) in the Direct mode are supported OS authentication in the Direct mode is supported NChar literal replacement is supported CLOB parameters behavior when UnicodeEnvironment=True is improved Bug with lost chars in a parameter value when ConvertEOL=True is fixed SQLServer data provider Bug with processing varchar fields when AutoTranslate is True in the Direct mode is fixed Bug with processing a field with alias for query with the JOIN statement is fixed Bug with date and time fractional seconds precision when DescribeParams = True is fixed MySQL data provider Azure Database for MySQL is supported JSON data type is supported InterBase data provider Support for Firebird on Android platform is added Support for Firebird 3 packages is added Aliases handling in the RETURNING clause is supported The WireCompression connection parameter for Firebird 3 is supported Bug with using BLOB data type in batch operations is fixed Bug with the OnBackupProgress event handler in TUniDADump is fixed Bug with using batch parameters of the Bytes type is fixed Bug with closing a connection that has an active transaction for Firebird 3 is fixed Bug with recreating a connection on Linux and mobile platforms is fixed PostgreSQL data provider SSPI authentication is supported Processing GUID data type for the TGuidField class is improved SQLite data provider Now the Direct mode is based on the SQLite engine version 3.20.0 Custom SQL aggregate functions are supported Bug with opening an existing database on iOS 64 is fixed Bug with detecting field types is fixed Bug with international symbols in non-Unicode Delphi versions is fixed Bug with low performance of the LoadFromDataSet method of the Loader component is fixed Bug with index backup using the Dump component when the TableNames property is set is fixed DBF data provider The CodePage specific options are added The ConnectMode specific options are added Bug with using CDX indexes is fixed DB2 data provider The DECFLOAT data type is supported

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值