本文整理汇总了PHP中Configuration::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::where方法的具体用法?PHP Configuration::where怎么用?PHP Configuration::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration::where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isSuccesful
public function isSuccesful()
{
foreach ((array) $_REQUEST as $ixField => $fieldValue) {
$this->responseFields[$ixField] = $fieldValue;
}
$sSignatureBase = sprintf("%03s", $this->responseFields['ver']) . sprintf("%-10s", $this->responseFields['id']) . sprintf("%012s", $this->responseFields['ecuno']) . sprintf("%06s", $this->responseFields['receipt_no']) . sprintf("%012s", $this->responseFields['eamount']) . sprintf("%3s", $this->responseFields['cur']) . $this->responseFields['respcode'] . $this->responseFields['datetime'] . $this->mb_sprintf("%-40s", $this->responseFields['msgdata']) . $this->mb_sprintf("%-40s", $this->responseFields['actiontext']);
function hex2str($hex)
{
$str = '';
for ($i = 0; $i < strlen($hex); $i += 2) {
$str .= chr(hexdec(substr($hex, $i, 2)));
}
return $str;
}
$mac = hex2str($this->responseFields['mac']);
$flKey = openssl_get_publickey(\Configuration::where('code', '=', 'estcard/pubkey')->first()->value);
if (!openssl_verify($sSignatureBase, $mac, $flKey)) {
// invalidSignature
return false;
}
if ($this->responseFields['receipt_no'] == 00) {
# Payment was cancelled
return false;
}
if ($this->responseFields['respcode'] == 00) {
# Payment success
return true;
}
}
示例2: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$this->line('Welcome to the job cron.');
$auto_close = Configuration::where('key', 'auto_close')->first();
if ($auto_close['value']) {
$auto_close_time = Configuration::where('key', 'auto_close_time')->first();
$diff_time = date("Y-m-d H:i:s", time() - $auto_close_time['value'] * 60 * 60);
$jobs = Job::where('status', '=', '1')->where('invalid', '=', '0')->where('start_time', '<', $diff_time)->get();
foreach ($jobs as $job) {
Job::where('id', $job->id)->update(array('status' => 2));
}
}
$this->line('Done !');
}
示例3: beerOfTheDay
public function beerOfTheDay()
{
$dateInDatabase = Configuration::where('name', '=', 'beer_of_the_day_modification_date')->first();
$date = Carbon::createFromFormat("Y-m-d", "{$dateInDatabase->value}");
$now = Carbon::now();
$difference = $now->diffInDays($date);
if ($difference >= 1) {
$dateInDatabase->value = $now->format('Y-m-d');
$dateInDatabase->save();
$beer = $this->generateRandomBeer();
$selectedBeer = new Configuration();
$selectedBeer->name = "beer_id";
$selectedBeer->value = $beer->beer_id;
$selectedBeer->save();
} else {
$beer = Beer::find(Configuration::where('name', '=', 'beer_id')->orderBy('id', 'desc')->first()->value);
}
return View::make('beers.beer-of-the-day')->with(['beer' => $beer]);
}
示例4: register
public function register()
{
$this->app->bind('banklink', function ($app, $parameters) {
switch ($parameters['bank_code']) {
case 'seb':
$protocol = new Protocol\iPizza(@\Configuration::where('code', '=', 'seb/vk_snd_id')->first()->value, @\Configuration::where('code', '=', 'seb/vk_name')->first()->value, @\Configuration::where('code', '=', 'seb/vk_acc')->first()->value, @\Configuration::where('code', '=', 'seb/vk_privkey')->first()->value, @\Configuration::where('code', '=', 'seb/vk_pubkey')->first()->value, @$parameters['return_url'], $mbStrlen = true);
return new SEB($protocol, $testMode = false, @\Configuration::where('code', '=', 'seb/vk_dest')->first()->value);
case 'swedbank':
$protocol = new Protocol\iPizza(@\Configuration::where('code', '=', 'swedbank/vk_snd_id')->first()->value, @\Configuration::where('code', '=', 'swedbank/vk_name')->first()->value, @\Configuration::where('code', '=', 'swedbank/vk_acc')->first()->value, @\Configuration::where('code', '=', 'swedbank/vk_privkey')->first()->value, @\Configuration::where('code', '=', 'swedbank/vk_pubkey')->first()->value, @$parameters['return_url'], $mbStrlen = true);
return new Swedbank($protocol, $testMode = false, @\Configuration::where('code', '=', 'swedbank/vk_dest')->first()->value);
case 'nordea':
$protocol = new Protocol\Solo(@\Configuration::where('code', '=', 'nordea/rcv_id')->first()->value, @\Configuration::where('code', '=', 'nordea/mac_key')->first()->value, @$parameters['return_url'], @\Configuration::where('code', '=', 'nordea/rcv_name')->first()->value, @\Configuration::where('code', '=', 'nordea/rcv_account')->first()->value);
return new Nordea($protocol, $testMode = false, isset($parameters['auth']) ? \Configuration::where('code', '=', 'nordea/vk_dest_auth')->first()->value : \Configuration::where('code', '=', 'nordea/vk_dest')->first()->value);
case 'lhv':
$protocol = new Protocol\iPizza(@\Configuration::where('code', '=', 'lhv/vk_snd_id')->first()->value, @\Configuration::where('code', '=', 'lhv/vk_name')->first()->value, @\Configuration::where('code', '=', 'lhv/vk_acc')->first()->value, @\Configuration::where('code', '=', 'lhv/vk_privkey')->first()->value, @\Configuration::where('code', '=', 'lhv/vk_pubkey')->first()->value, @$parameters['return_url'], $mbStrlen = true);
return new LHV($protocol, $testMode = false, @\Configuration::where('code', '=', 'lhv/vk_dest')->first()->value);
case 'danske':
$protocol = new Protocol\iPizza(@\Configuration::where('code', '=', 'danske/vk_snd_id')->first()->value, @\Configuration::where('code', '=', 'danske/vk_name')->first()->value, @\Configuration::where('code', '=', 'danske/vk_acc')->first()->value, @\Configuration::where('code', '=', 'danske/vk_privkey')->first()->value, @\Configuration::where('code', '=', 'danske/vk_pubkey')->first()->value, @$parameters['return_url'], $mbStrlen = true);
return new DanskeBank($protocol, $testMode = false, @\Configuration::where('code', '=', 'danske/vk_dest')->first()->value);
case 'estcard':
return new Estcard(@\Configuration::where('code', '=', 'estcard/url')->first()->value, @$parameters['return_url'], @\Configuration::where('code', '=', 'estcard/id')->first()->value);
}
});
}
示例5: showHome
public function showHome()
{
$beer = Beer::find(Configuration::where('name', '=', 'beer_id')->orderBy('id', 'desc')->first()->value);
return View::make('home')->with(['beer' => $beer]);
}