當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Plan::getTableName方法代碼示例

本文整理匯總了PHP中Plan::getTableName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Plan::getTableName方法的具體用法?PHP Plan::getTableName怎麽用?PHP Plan::getTableName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Plan的用法示例。


在下文中一共展示了Plan::getTableName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: search

 /**
  * Search Licenses
  */
 static function search($q = NULL, $param = NULL, $product_code = NULL)
 {
     $_tbl_licenses = License::getTableName();
     $_tbl_licensesUses = LicensesUses::getTableName();
     $_tbl_transactions = Transaction::getTableName();
     $_tbl_purchases = Purchase::getTableName();
     $_tbl_products = Product::getTableName();
     $_tbl_plans = Plan::getTableName();
     $_tbl_buyers = Buyer::getTableName();
     $fields = array("{$_tbl_licenses}.*", DB::raw("COUNT({$_tbl_licensesUses}.id) AS totalUsed"), "{$_tbl_buyers}.first_name", "{$_tbl_buyers}.last_name", "{$_tbl_buyers}.email", "{$_tbl_products}.code", "{$_tbl_plans}.code AS plan_code", "{$_tbl_products}.api_key");
     $licenses = DB::table($_tbl_licenses)->leftJoin($_tbl_licensesUses, "{$_tbl_licensesUses}.license_id", '=', "{$_tbl_licenses}.id")->join($_tbl_transactions, "{$_tbl_transactions}.id", '=', "{$_tbl_licenses}.transaction_id")->join($_tbl_plans, "{$_tbl_transactions}.plan_id", '=', "{$_tbl_plans}.id")->join($_tbl_purchases, "{$_tbl_purchases}.id", '=', "{$_tbl_transactions}.purchase_id")->join($_tbl_products, "{$_tbl_products}.id", '=', "{$_tbl_purchases}.product_id")->join($_tbl_buyers, "{$_tbl_buyers}.id", '=', "{$_tbl_purchases}.buyer_id")->select($fields)->groupBy("{$_tbl_licenses}.id");
     $q = $q ? $q : Input::get('q');
     $param = $param ? $param : Input::get('param');
     if ($q) {
         if ($param == "key") {
             $licenses = $licenses->where("license_key", '=', $q);
         }
         if ($param == "email") {
             $licenses = $licenses->where("email", '=', $q);
         }
         if ($product_code) {
             $licenses = $licenses->where($_tbl_licenses . ".license_key", 'LIKE', strtoupper($product_code) . '-%');
         }
     }
     return $licenses->orderBy($_tbl_licenses . '.created_at', 'DESC')->paginate(25);
 }
開發者ID:michaelotto126,項目名稱:dksolution,代碼行數:29,代碼來源:License.php

示例2: getRefundQueue

 static function getRefundQueue()
 {
     $_tbl_transactions = Transaction::getTableName();
     $_tbl_purchases = Purchase::getTableName();
     $_tbl_products = Product::getTableName();
     $_tbl_plans = Plan::getTableName();
     $_tbl_affiliates = Affiliate::getTableName();
     $_tbl_buyers = Buyer::getTableName();
     $fields = array("{$_tbl_transactions}.*", "{$_tbl_purchases}.affiliate_id", "{$_tbl_purchases}.product_id", "{$_tbl_products}.name AS product_name", "{$_tbl_plans}.name AS plan_name", "{$_tbl_affiliates}.name AS affiliate_name", "{$_tbl_buyers}.first_name AS buyer_first_name", "{$_tbl_buyers}.last_name AS buyer_last_name", "{$_tbl_buyers}.email AS buyer_email");
     $transaction = DB::table($_tbl_transactions)->join($_tbl_purchases, "{$_tbl_purchases}.id", '=', "{$_tbl_transactions}.purchase_id")->join($_tbl_products, "{$_tbl_products}.id", '=', "{$_tbl_purchases}.product_id")->join($_tbl_plans, "{$_tbl_plans}.id", '=', "{$_tbl_transactions}.plan_id")->join($_tbl_buyers, "{$_tbl_buyers}.id", '=', "{$_tbl_purchases}.buyer_id")->leftJoin($_tbl_affiliates, "{$_tbl_affiliates}.id", '=', "{$_tbl_purchases}.affiliate_id")->select($fields);
     $transaction = $transaction->where("{$_tbl_transactions}.is_refunded", '=', 1)->where("{$_tbl_transactions}.commission_refunded", '=', 0);
     return $transaction->paginate(25);
 }
開發者ID:michaelotto126,項目名稱:dksolution,代碼行數:13,代碼來源:Transaction.php


注:本文中的Plan::getTableName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。