当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseManager::raw方法代码示例

本文整理汇总了PHP中Illuminate\Database\DatabaseManager::raw方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseManager::raw方法的具体用法?PHP DatabaseManager::raw怎么用?PHP DatabaseManager::raw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Database\DatabaseManager的用法示例。


在下文中一共展示了DatabaseManager::raw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: archive

 /**
  * @param $year
  * @param $month
  * @return \Illuminate\View\View
  */
 public function archive($year, $month)
 {
     $data = $this->getOverviewData();
     $posts = $this->post->forPublic()->where($this->db->raw('MONTHNAME(publish_date)'), '=', $month)->where($this->db->raw('YEAR(publish_date)'), '=', $year)->orderBy('publish_date', 'DESC')->paginate($this->config->items_per_page);
     $data['posts'] = $this->dateFormat($posts);
     $data['headings'] = "All posts from <strong>" . $month . " " . $year . "</strong>";
     return view('blogify.index', $data);
 }
开发者ID:sparkan,项目名称:sparkvel,代码行数:13,代码来源:BlogController.php

示例2: __construct

 public function __construct(DatabaseManager $DB, AuthenticationManagementInterface $AuthenticationManager, Translator $Lang)
 {
     // $this->DB = $DB;
     // $this->DB->connection()->enableQueryLog();
     $this->Database = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Account AS a')->leftJoin('ACCT_Account AS ap', 'ap.id', '=', 'a.parent_account_id')->join('ACCT_Account_Type AS at', 'at.id', '=', 'a.account_type_id')->where('a.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->whereNull('a.deleted_at');
     $this->visibleColumns = array('a.id AS acct_am_id', 'a.key as acct_am_key', 'a.name as acct_am_name', 'a.balance_type as acct_am_balance_type', 'a.is_group as acct_am_is_group', 'a.account_type_id as acct_am_account_type_id', 'at.name as acct_am_account_type', 'ap.id as acct_am_parent_account_id', 'ap.key as acct_am_parent_key', 'ap.name as acct_am_parent_account', $DB->raw('CASE a.balance_type WHEN "D" THEN "' . $Lang->get('decima-accounting::account-management.D') . '" ELSE "' . $Lang->get('decima-accounting::account-management.A') . '" END AS acct_am_balance_type_name'), $DB->raw('CASE a.is_group WHEN 1 THEN 0 ELSE 1 END AS acct_am_is_leaf'));
     $this->orderBy = array(array('acct_am_key', 'asc'));
     $this->treeGrid = true;
     $this->parentColumn = 'ap.id';
     $this->leafColumn = 'acct_am_is_leaf';
 }
开发者ID:mgallegos,项目名称:decima-accounting,代码行数:11,代码来源:EloquentAccountGridRepository.php

示例3: inConversation

 /**
  * Check if given participants are
  * in a conversation
  *
  * @param $participants
  * @return mixed
  */
 public function inConversation($participants)
 {
     list($num_user_in_conversation, $valuesEscaped) = $this->getEscapedValues($participants);
     // prepare question marks for the query
     $questionmarks = str_repeat("?,", $num_user_in_conversation - 1) . "?";
     $query = $this->db->select($this->db->raw('select cu.conversation_id, cu.deleted_at
                     from conversation_joined cu
                     group by cu.conversation_id, cu.deleted_at
                     having SUM(cu.participant_id in ( ' . $questionmarks . ' )) = ? and
                            SUM(cu.participant_id not in ( ' . $questionmarks . ' )) = 0
                            '), $valuesEscaped);
     return $query;
 }
开发者ID:fenos,项目名称:mex,代码行数:20,代码来源:ConversationJoinedRepository.php

示例4: __construct

 public function __construct(DatabaseManager $DB, AuthenticationManagementInterface $AuthenticationManager, Translator $Lang)
 {
     $this->DB = $DB;
     $this->AuthenticationManager = $AuthenticationManager;
     /*
     $this->Database = $DB->table('ACCT_Journal_Entry AS je')
     						->join('ACCT_Journal_Voucher AS jv', 'jv.id', '=', 'je.journal_voucher_id')
     						->rightJoin('ACCT_Account AS c', 'je.account_id', '=', 'c.id')
     						->join('ACCT_Account_Type AS at', 'at.id', '=', 'c.account_type_id')
     						->where(function($query)
     		                {
     		                  $query->orWhere('jv.status', '=', 'B');
     		                  $query->orWhereNull('jv.status');
     		                }
     						)
     						->where('c.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())
     						->whereIn('at.pl_bs_category', array('B', 'C'))
     						->whereNull('je.deleted_at')
     						->whereNull('jv.deleted_at');
     */
     $this->Database = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Journal_Entry AS je')->join('ACCT_Journal_Voucher AS jv', 'jv.id', '=', 'je.journal_voucher_id')->rightJoin('ACCT_Account AS c', 'je.account_id', '=', 'c.id')->join('ACCT_Account_Type AS at', 'at.id', '=', 'c.account_type_id')->where('jv.status', '=', 'B')->where('jv.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->where('c.is_group', '=', 0)->whereIn('at.pl_bs_category', array('B', 'C'))->whereNull('je.deleted_at')->whereNull('jv.deleted_at');
     $this->Database2 = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Account AS c')->join('ACCT_Account_Type AS at', 'at.id', '=', 'c.account_type_id')->where('c.is_group', '=', 1)->where('c.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->whereIn('at.pl_bs_category', array('B', 'C'))->select(array($DB->raw('0 AS acct_pl_debit'), $DB->raw('0 AS acct_pl_credit'), 'c.id AS acct_pl_account_id', 'c.parent_account_id AS acct_pl_parent_account_id', 'c.key AS acct_pl_account_key', 'c.name AS acct_pl_account_name', 'c.is_group AS acct_pl_is_group', 'c.balance_type AS acct_pl_balance_type', $DB->raw('CASE at.pl_bs_category WHEN "B" THEN "' . $Lang->get('decima-accounting::profit-and-loss.income') . '" ELSE "' . $Lang->get('decima-accounting::profit-and-loss.expenses') . '" END AS acct_pl_pl_bs_category'), $DB->raw('0 AS acct_pl_balance')));
     $this->visibleColumns = array($DB->raw('IFNULL(SUM(je.debit),0) AS acct_pl_debit'), $DB->raw('IFNULL(SUM(je.credit),0) AS acct_pl_credit'), 'c.id AS acct_pl_account_id', 'c.parent_account_id AS acct_pl_parent_account_id', 'c.key AS acct_pl_account_key', 'c.name AS acct_pl_account_name', 'c.is_group AS acct_pl_is_group', 'c.balance_type AS acct_pl_balance_type', $DB->raw('CASE at.pl_bs_category WHEN "B" THEN "' . $Lang->get('decima-accounting::profit-and-loss.income') . '" ELSE "' . $Lang->get('decima-accounting::profit-and-loss.expenses') . '" END AS acct_pl_pl_bs_category'), $DB->raw('0 AS acct_pl_balance'));
     $this->orderBy = array(array('acct_pl_account_key', 'asc'));
 }
开发者ID:mgallegos,项目名称:decima-accounting,代码行数:25,代码来源:EloquentProfitAndLossGridRepository.php

示例5: filterQuery

	/**
	 * Adds selects to a query
	 *
	 * @param array 	$selects
	 *
	 * @return void
	 */
	public function filterQuery(&$selects)
	{
		if ($select = $this->getOption('select'))
		{
			$selects[] = $this->db->raw($select . ' AS ' . $this->db->getQueryGrammar()->wrap($this->getOption('column_name')));
		}
	}
开发者ID:pcerbino,项目名称:falcionevega,代码行数:14,代码来源:Column.php

示例6: tableToJoin

 /**
  * Return the table to join.
  *
  * @return string|mixed
  */
 public function tableToJoin()
 {
     $table = $this->table;
     if ($this->table !== $this->tableAlias) {
         $table = DB::raw("{$this->table} as {$this->tableAlias}");
     }
     return $table;
 }
开发者ID:sedp-mis,项目名称:base-report,代码行数:13,代码来源:BaseModelGridQuery.php

示例7: __construct

 public function __construct(DatabaseManager $DB, AuthenticationManagementInterface $AuthenticationManager, AccountManagementInterface $AccountManager, Translator $Lang, Carbon $Carbon)
 {
     $this->DB = $DB;
     $this->AccountManager = $AccountManager;
     $this->AuthenticationManager = $AuthenticationManager;
     $this->Carbon = $Carbon;
     $this->Database = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Journal_Entry AS je')->join('ACCT_Account AS c', 'je.account_id', '=', 'c.id')->join('ACCT_Journal_Voucher AS jv', 'jv.id', '=', 'je.journal_voucher_id')->leftJoin('PURCH_Document_Type AS dt', 'dt.id', '=', 'jv.document_type_id')->leftJoin('PURCH_Supplier AS ps', 'ps.id', '=', 'jv.supplier_id')->leftJoin('SALE_Client AS cl', 'cl.id', '=', 'jv.client_id')->leftJoin('HR_Employee AS e', 'e.id', '=', 'jv.employee_id')->join('ACCT_Voucher_Type AS vt', 'vt.id', '=', 'jv.voucher_type_id')->where('jv.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->where('c.is_group', '=', 0)->where('jv.status', '=', 'B')->whereNull('je.deleted_at')->whereNull('jv.deleted_at')->select(array('jv.date', 'jv.number', 'jv.remark', 'jv.manual_reference', 'vt.name AS voucher_type_name', 'jv.document_date', 'jv.document_number', 'jv.document_amount', 'dt.name AS document_type_name', $DB->raw('CONCAT(e.names, \' \', e.surnames) AS employee_name'), 'e.tax_id as employee_tax_id', 'e.single_identity_document_number as employee_single_identity_document_number', 'ps.name as supplier_name', 'ps.registration_number AS supplier_registration_number', 'ps.tax_id as supplier_tax_id', 'ps.single_identity_document_number as supplier_single_identity_document_number', 'cl.name as client_name', 'cl.registration_number AS client_registration_number', 'cl.tax_id as client_tax_id', 'cl.single_identity_document_number as client_single_identity_document_number', 'c.key AS account_key', 'c.name AS account_name', 'je.debit', 'je.credit'));
     $this->orderBy = array(array('jv.document_date', 'asc'));
 }
开发者ID:mgallegos,项目名称:decima-accounting,代码行数:9,代码来源:EloquentTaxControlGridRepository.php

示例8: queryUsersByIdentifier

 /**
  * @param string $identifier
  *
  * @return \Illuminate\Database\Query\Builder
  */
 public function queryUsersByIdentifier($identifier)
 {
     $first = $this->getEntities()->first();
     $query = $this->database->table($first->table)->selectRaw($this->database->raw("'{$first->type}' AS type, id, `{$first->identifier}` AS identifier"))->where($first->identifier, '=', $identifier);
     foreach ($this->getEntities()->slice(1) as $entity) {
         $subQuery = $this->database->table($entity->table)->selectRaw($this->database->raw("'{$entity->type}' AS type, id, `{$entity->identifier}` AS identifier"))->where($entity->identifier, '=', $identifier);
         $query = $query->union($subQuery);
     }
     return $query;
 }
开发者ID:bogardo,项目名称:multiauth,代码行数:15,代码来源:Service.php

示例9: __construct

 public function __construct(DatabaseManager $DB, AuthenticationManagementInterface $AuthenticationManager, Translator $Lang)
 {
     // $this->DB = $DB;
     // $this->DB->connection()->enableQueryLog();
     $this->Database = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Cost_Center AS c')->leftJoin('ACCT_Cost_Center AS cp', 'cp.id', '=', 'c.parent_cc_id')->where('c.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->whereNull('c.deleted_at');
     $this->visibleColumns = array('c.id AS acct_ccm_id', 'c.key as acct_ccm_key', 'c.name as acct_ccm_name', 'c.is_group as acct_ccm_is_group', 'cp.id as acct_ccm_parent_cc_id', 'cp.key as acct_ccm_parent_key', 'cp.name as acct_ccm_parent_cc', $DB->raw('CASE c.is_group WHEN 1 THEN 0 ELSE 1 END AS acct_ccm_is_leaf'));
     $this->orderBy = array(array('acct_ccm_key', 'asc'));
     $this->treeGrid = true;
     $this->parentColumn = 'cp.id';
     $this->leafColumn = 'acct_ccm_is_leaf';
 }
开发者ID:mgallegos,项目名称:decima-accounting,代码行数:11,代码来源:EloquentCostCenterGridRepository.php

示例10: __construct

 public function __construct(DatabaseManager $DB, AuthenticationManagementInterface $AuthenticationManager, Translator $Lang)
 {
     /*
     $this->Database = $DB->table('ACCT_Journal_Voucher AS jv')
     						->join('ACCT_Voucher_Type AS vt', 'vt.id', '=', 'jv.voucher_type_id')
     						->where('jv.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())
     						->whereNull('jv.deleted_at');
     
     $this->visibleColumns = array('jv.id', 'jv.number', 'jv.date', 'jv.manual_reference', 'jv.remark', 'jv.is_editable', 'jv.status',
     															'vt.name', 'vt.lang_key',
     );
     */
     //$DB->connection()->enableQueryLog();
     // $this->DB = $DB;
     //
     // $this->DB->connection()->enableQueryLog();
     $this->Database = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Journal_Voucher AS jv')->leftJoin('ACCT_Journal_Entry AS je', 'je.journal_voucher_id', '=', 'jv.id')->leftJoin('PURCH_Document_Type AS dt', 'dt.id', '=', 'jv.document_type_id')->leftJoin('PURCH_Supplier AS ps', 'ps.id', '=', 'jv.supplier_id')->leftJoin('SALE_Client AS cl', 'cl.id', '=', 'jv.client_id')->leftJoin('HR_Employee AS e', 'e.id', '=', 'jv.employee_id')->join('ACCT_Voucher_Type AS vt', 'vt.id', '=', 'jv.voucher_type_id')->join('ACCT_Period AS p', 'p.id', '=', 'jv.period_id')->leftJoin('ACCT_Cost_Center AS cc', 'cc.id', '=', 'je.cost_center_id')->leftJoin('ACCT_Account AS c', 'c.id', '=', 'je.account_id')->where('jv.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->whereNull('je.deleted_at')->whereNull('jv.deleted_at');
     $this->visibleColumns = array('jv.id AS voucher_id', 'jv.number', 'jv.date', 'jv.manual_reference', 'jv.remark', 'jv.is_editable', 'jv.status', 'jv.document_date', 'jv.document_number', 'jv.document_amount', 'je.debit AS debit_0', 'je.credit AS credit_0', 'dt.id AS document_type_id', 'dt.name AS document_type_label', 'ps.id AS supplier_id', 'ps.name AS supplier_label', 'cl.id AS client_id', 'cl.name AS client_label', 'e.id AS employee_id', $DB->raw('CONCAT(e.names, \' \', e.surnames) AS employee_label'), 'vt.id AS voucher_type_id', 'vt.name AS voucher_type', 'cc.id AS cost_center_id_0', 'cc.key AS cost_center_key_0', 'cc.name AS cost_center_name_0', 'c.id AS account_id_0', 'c.key AS account_key_0', 'c.name AS account_name_0', 'p.id AS period_id', $DB->raw('CONCAT("#", LPAD(jv.number, 4, 0), " - P", LPAD(month, 2, 0), " - ", DATE_FORMAT(jv.date, "' . $Lang->get('form.mysqlDateFormat') . '"), " - ", vt.name, " - ", IFNULL(jv.manual_reference,"' . $Lang->get('decima-accounting::journal-management.noRef') . '"), " - ", jv.remark) AS voucher_header'));
     //var_dump($DB->raw('CONCAT(jv.date, ' - ', jv.number, ' - ', vt.name) AS voucher_header'));die();
     //var_dump($DB->raw('concat(jv.date, " - ", jv.number) AS voucher_header'));die();
     $this->orderBy = array(array('voucher_header', 'desc'));
 }
开发者ID:mgallegos,项目名称:decima-accounting,代码行数:22,代码来源:EloquentJournalVoucherGridRepository.php

示例11: all

 /**
  * @param       $filters
  * @param  null $limit
  *
  * @return \Illuminate\Database\Eloquent\Collection|static[]
  */
 public function all($filters, $limit = null)
 {
     $query = $this->post->select('*');
     $from = "posts ";
     if (isset($filters['post_type']) && $filters['post_type'] != '') {
         $post_type = $filters['post_type'];
         $query->whereRaw("posts.metadata->>'type' = ?", [$post_type]);
     }
     $query->from($this->db->raw($from));
     $query->orderBy('updated_at', 'DESC');
     $query->published();
     return $query->paginate();
 }
开发者ID:Shuvayatra,项目名称:migration-web,代码行数:19,代码来源:PostRepository.php

示例12: __construct

 public function __construct(DatabaseManager $DB, AuthenticationManagementInterface $AuthenticationManager, Translator $Lang)
 {
     $this->DB = $DB;
     $this->AuthenticationManager = $AuthenticationManager;
     //$this->DB->connection()->enableQueryLog();
     /*
     $this->Database = $DB->table('ACCT_Journal_Entry AS je')
     						->join('ACCT_Journal_Voucher AS jv', 'jv.id', '=', 'je.journal_voucher_id')
     						->rightJoin('ACCT_Account AS c', 'je.account_id', '=', 'c.id')
     						->join('ACCT_Account_Type AS at', 'at.id', '=', 'c.account_type_id')
     						->where(function($query)
     		                {
     		                  $query->orWhere('jv.status', '=', 'B');
     		                  $query->orWhereNull('jv.status');
     		                }
     						)
     						->where('c.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())
     						->whereIn('at.pl_bs_category', array('D', 'E'))
     						->whereNull('je.deleted_at')
     						->whereNull('jv.deleted_at');
     						//->groupBy('c.id', 'c.parent_account_id', 'c.key', 'c.name', 'at.name');
     
     $this->visibleColumns = array($DB->raw('IFNULL(SUM(je.debit),0) AS acct_bs_debit'), $DB->raw('IFNULL(SUM(je.credit),0) AS acct_bs_credit'),
     															'c.id AS acct_bs_account_id', 'c.parent_account_id AS acct_bs_parent_account_id','c.key AS acct_bs_account_key', 'c.name AS acct_bs_account_name', 'c.is_group AS acct_bs_is_group', 'c.balance_type AS acct_bs_balance_type',
     															$DB->raw('CASE at.pl_bs_category WHEN "D" THEN "' . $Lang->get('decima-accounting::balance-sheet.assets') . '" ELSE "' . $Lang->get('decima-accounting::balance-sheet.liability') . '" END AS acct_bs_pl_bs_category'),
     															//$DB->raw('CASE balance_type WHEN "D" THEN IFNULL(SUM(je.debit),0) - IFNULL(SUM(je.credit),0) ELSE IFNULL(SUM(je.credit),0) - IFNULL(SUM(je.debit),0) END AS acct_bs_balance'),
     															$DB->raw('0 AS acct_bs_balance'),
     															//'at.name AS acct_bs_account_type_name'
     															//$DB->raw('CONCAT(" ", DATE_FORMAT(jv.date, "%c"), " - ", DATE_FORMAT(jv.date, "' . $Lang->get('form.mysqlDateFormat') . '"), " - #", jv.number, " - ", vt.name, " - ", IFNULL(jv.manual_reference,"No Ref."), " - ", jv.remark) AS voucher_header')
     															//$DB->raw('count(*) AS voucher_header')
     );
     */
     $this->Database = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Journal_Entry AS je')->join('ACCT_Journal_Voucher AS jv', 'jv.id', '=', 'je.journal_voucher_id')->rightJoin('ACCT_Account AS c', 'je.account_id', '=', 'c.id')->join('ACCT_Account_Type AS at', 'at.id', '=', 'c.account_type_id')->where('jv.status', '=', 'B')->where('c.is_group', '=', 0)->where('jv.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->whereIn('at.pl_bs_category', array('D', 'E'))->whereNull('je.deleted_at')->whereNull('jv.deleted_at');
     //->groupBy('c.id', 'c.parent_account_id', 'c.key', 'c.name', 'at.name');
     $this->visibleColumns = array($DB->raw('IFNULL(SUM(je.debit),0) AS acct_bs_debit'), $DB->raw('IFNULL(SUM(je.credit),0) AS acct_bs_credit'), 'c.id AS acct_bs_account_id', 'c.parent_account_id AS acct_bs_parent_account_id', 'c.key AS acct_bs_account_key', 'c.name AS acct_bs_account_name', 'c.is_group AS acct_bs_is_group', 'c.balance_type AS acct_bs_balance_type', $DB->raw('CASE at.pl_bs_category WHEN "D" THEN "' . $Lang->get('decima-accounting::balance-sheet.assets') . '" ELSE "' . $Lang->get('decima-accounting::balance-sheet.liability') . '" END AS acct_bs_pl_bs_category'), $DB->raw('0 AS acct_bs_balance'));
     $this->Database2 = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Journal_Entry AS je')->join('ACCT_Journal_Voucher AS jv', 'jv.id', '=', 'je.journal_voucher_id')->rightJoin('ACCT_Account AS c', 'je.account_id', '=', 'c.id')->join('ACCT_Account_Type AS at', 'at.id', '=', 'c.account_type_id')->where(function ($query) {
         $query->orWhere('jv.status', '=', 'B');
         $query->orWhereNull('jv.status');
     })->where('jv.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->whereIn('at.pl_bs_category', array('B'))->whereNull('je.deleted_at')->whereNull('jv.deleted_at');
     $this->Database4 = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Journal_Entry AS je')->join('ACCT_Journal_Voucher AS jv', 'jv.id', '=', 'je.journal_voucher_id')->rightJoin('ACCT_Account AS c', 'je.account_id', '=', 'c.id')->join('ACCT_Account_Type AS at', 'at.id', '=', 'c.account_type_id')->where(function ($query) {
         $query->orWhere('jv.status', '=', 'B');
         $query->orWhereNull('jv.status');
     })->where('jv.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->whereIn('at.pl_bs_category', array('C'))->whereNull('je.deleted_at')->whereNull('jv.deleted_at');
     $this->Database3 = $DB->connection($AuthenticationManager->getCurrentUserOrganizationConnection())->table('ACCT_Account AS c')->join('ACCT_Account_Type AS at', 'at.id', '=', 'c.account_type_id')->where('c.is_group', '=', 1)->where('c.organization_id', '=', $AuthenticationManager->getCurrentUserOrganizationId())->whereIn('at.pl_bs_category', array('D', 'E'))->select(array($DB->raw('0 AS acct_bs_debit'), $DB->raw('0 AS acct_bs_credit'), 'c.id AS acct_bs_account_id', 'c.parent_account_id AS acct_bs_parent_account_id', 'c.key AS acct_bs_account_key', 'c.name AS acct_bs_account_name', 'c.is_group AS acct_bs_is_group', 'c.balance_type AS acct_bs_balance_type', $DB->raw('CASE at.pl_bs_category WHEN "D" THEN "' . $Lang->get('decima-accounting::balance-sheet.assets') . '" ELSE "' . $Lang->get('decima-accounting::balance-sheet.liability') . '" END AS acct_bs_pl_bs_category'), $DB->raw('0 AS acct_bs_balance')));
     $this->orderBy = array(array('acct_bs_account_key', 'asc'));
 }
开发者ID:mgallegos,项目名称:decima-accounting,代码行数:46,代码来源:EloquentBalanceSheetGridRepository.php

示例13: filterBySearchTerm

 /**
  * Filters a relationship options query by a search term
  *
  * @param mixed										$term
  * @param \Illuminate\Database\Query\Builder		$query
  * @param array										$selectedItems
  * @param \Frozennode\Administrator\Fields\Field	$fieldObject
  * @param string									$relatedKeyTable
  */
 public function filterBySearchTerm($term, EloquentBuilder &$query, Field $fieldObject, array $selectedItems, $relatedKeyTable)
 {
     if ($term) {
         //set up the wheres
         foreach ($fieldObject->getOption('search_fields') as $search) {
             $query->where($this->db->raw($search), 'LIKE', '%' . $term . '%');
         }
         //exclude the currently-selected items if there are any
         if (count($selectedItems)) {
             $query->whereNotIn($relatedKeyTable, $selectedItems);
         }
         //set up the limits
         $query->take($fieldObject->getOption('num_options') + count($selectedItems));
     }
 }
开发者ID:EmersonStone,项目名称:Laravel-Administrator,代码行数:24,代码来源:Factory.php

示例14: getUsersWithCountryContract

 /**
  * Get country all users
  *
  * @return Collection/null
  */
 public function getUsersWithCountryContract()
 {
     $query = $this->user->select('name', 'id');
     $countries = $this->auth->user()->country;
     $from = "users";
     $from .= ",json_array_elements(users.country) r";
     if (!is_null($countries)) {
         $query->whereRaw("trim(both '\"' from r::text) in (?)", $countries);
     }
     $query->from($this->db->raw($from));
     $list = [];
     foreach ($query->get() as $v) {
         $list[$v->id] = $v->name;
     }
     return $list;
 }
开发者ID:sadhakbj,项目名称:resourcecontracts.org,代码行数:21,代码来源:UserRepository.php

示例15: showCategoriesTable

 /**
  * Return the admin categories view.
  *
  * @return \Illuminate\View\View
  */
 public function showCategoriesTable(DatabaseManager $database)
 {
     $categories = Category::query()->leftJoin('items')->addSelect($database->raw('COUNT(items.item_id) as item_count'))->groupBy('categories.category_id');
     $table = new AdminCategories($categories);
     $table->with('parent');
     return view('mustard::admin.categories', ['table' => $table, 'categories' => $table->paginate()]);
 }
开发者ID:hamjoint,项目名称:mustard,代码行数:12,代码来源:AdminController.php


注:本文中的Illuminate\Database\DatabaseManager::raw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。