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


PHP License::getTableName方法代码示例

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


在下文中一共展示了License::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: getUsage

 static function getUsage($id)
 {
     $_tbl_licenses = License::getTableName();
     $_tbl_licensesUses = LicensesUses::getTableName();
     $fields = array("{$_tbl_licensesUses}.*", "{$_tbl_licenses}.license_key");
     $usage = DB::table($_tbl_licensesUses)->join($_tbl_licenses, "{$_tbl_licenses}.id", '=', "{$_tbl_licensesUses}.license_id")->select($fields)->where("{$_tbl_licensesUses}.id", '=', $id)->first();
     return $usage;
 }
开发者ID:michaelotto126,项目名称:dksolution,代码行数:8,代码来源:LicensesUses.php


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