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


PHP sqldate函数代码示例

本文整理汇总了PHP中sqldate函数的典型用法代码示例。如果您正苦于以下问题:PHP sqldate函数的具体用法?PHP sqldate怎么用?PHP sqldate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: stockUpdate

 public function stockUpdate()
 {
     Larasset::start('header')->css('daterangepicker');
     Larasset::start('footer')->js('moment', 'daterangepicker');
     $daterange = Input::get('record_range');
     if (strpos($daterange, '-') !== FALSE) {
         $fromandto = explode('-', $daterange);
         $from = sqldate($fromandto[0]);
         $to_plus_1day = strtotime('now') - strtotime('yesterday') + strtotime($fromandto[1]);
         $to = sqldate(date('Y/n/d', $to_plus_1day));
         $data['todate'] = $fromandto[1];
     } else {
         $from = sqldate(date('Y/n/d', strtotime('first day of this month')));
         $to = sqldate('+1day');
         $data['todate'] = $to;
     }
     $data['fromdate'] = $from;
     $data['todate'] = $to;
     $time = array($data['fromdate'], $data['todate']);
     $activities = Usersactivity::where('activity_type', '=', 'stock')->whereBetween('created_at', $time)->orderBy('id', 'desc')->get();
     //$data = array();
     if ($activities != null) {
         $data['activities'] = $activities;
     }
     $this->layout->title = "Welcome to Admin Area";
     $this->layout->content = View::make('admin.stockupdate_record.index', $data);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:27,代码来源:AdminStockupdateRecordsController.php

示例2: updateloggedTime

 private function updateloggedTime($data)
 {
     $user = User::find(Auth::user()->id);
     $user->isloggedin = $data[0];
     $user->loggedtime = sqldate();
     $user->save();
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:7,代码来源:douseractivity.php

示例3: add

 public function add(array $values)
 {
     $users = tusers::i();
     $email = trim($values['email']);
     if ($users->emailexists($email)) {
         return false;
     }
     $groups = tusergroups::i();
     if (isset($values['idgroups'])) {
         $idgroups = $this->cleangroups($values['idgroups']);
         if (count($idgroups) == 0) {
             $idgroups = $groups->defaults;
         }
     } else {
         $idgroups = $groups->defaults;
     }
     $password = empty($values['password']) ? md5uniq() : $values['password'];
     $item = array('email' => $email, 'name' => isset($values['name']) ? trim($values['name']) : '', 'website' => isset($values['website']) ? trim($values['website']) : '', 'password' => litepublisher::$options->hash($email . $password), 'cookie' => md5uniq(), 'expired' => sqldate(), 'idgroups' => implode(',', $idgroups), 'trust' => 0, 'status' => isset($values['status']) ? $values['status'] : 'approved');
     $id = $users->db->add($item);
     $item['idgroups'] = $idgroups;
     $users->items[$id] = $item;
     $users->setgroups($id, $item['idgroups']);
     if ('approved' == $item['status']) {
         tuserpages::i()->add($id);
     }
     $users->added($id);
     return $id;
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:28,代码来源:usersman.class.php

示例4: run

 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('systemsettings')->truncate();
     $systemsettings = array('payment_mode' => 'Cash, Pos, Coupon', 'dob_alert_day' => '5', 'created_at' => sqldate(), 'updated_at' => sqldate());
     // Uncomment the below to run the seeder
     DB::table('systemsettings')->insert($systemsettings);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:8,代码来源:SystemsettingsTableSeeder.php

示例5: import

 public function import($url, $title, $posted, $ip, $status)
 {
     $item = array('url' => $url, 'title' => $title, 'post' => $this->pid, 'posted' => sqldate($posted), 'status' => $status, 'ip' => $ip);
     $id = $this->db->add($item);
     $item['id'] = $id;
     $this->items[$id] = $item;
     $this->updatecount($this->pid);
     return $id;
 }
开发者ID:laiello,项目名称:litepublisher,代码行数:9,代码来源:comments.pingbacks.class.db.php

示例6: tusersInstall

/**
* Lite Publisher
* Copyright (C) 2010 - 2015 Vladimir Yushko http://litepublisher.ru/ http://litepublisher.com/
* Dual licensed under the MIT (mit.txt)
* and GPL (gpl.txt) licenses.
**/
function tusersInstall($self)
{
    $manager = tdbmanager::i();
    $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
    $manager->CreateTable($self->table, file_get_contents($dir . 'users.sql'));
    //$manager->setautoincrement($self->table, 2);
    $manager->CreateTable($self->grouptable, file_get_contents($dir . 'usersgroups.sql'));
    $id = $self->db->add(array('email' => litepublisher::$options->email, 'name' => litepublisher::$site->author, 'website' => litepublisher::$site->url . '/', 'password' => '', 'cookie' => '', 'expired' => sqldate(), 'status' => 'approved', 'idgroups' => '1'));
    $self->setgroups($id, array(1));
}
开发者ID:laiello,项目名称:litepublisher,代码行数:16,代码来源:users.class.install.php

示例7: run

 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('modes')->truncate();
     $list = array('retail' => 1, 'wholesale' => 1, 'distributor' => 0, 'majordistributor' => 0);
     $modes = array();
     foreach ($list as $name => $status) {
         $modes[] = array('name' => $name, 'status' => $status, 'created_at' => sqldate(), 'updated_at' => sqldate());
     }
     // Uncomment the below to run the seeder
     DB::table('modes')->insert($modes);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:12,代码来源:ModesTableSeeder.php

示例8: run

 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('productcategories')->truncate();
     $list = array('Nail', 'Lips', 'Face', 'Eye', 'Others');
     $productcategories = array();
     foreach ($list as $cat) {
         $productcategories[] = array('name' => $cat, 'created_at' => sqldate(), 'updated_at' => sqldate());
     }
     // Uncomment the below to run the seeder
     DB::table('productcategories')->insert($productcategories);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:12,代码来源:ProductcategoriesTableSeeder.php

示例9: run

 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('menus')->truncate();
     $list = array('Dashboard' => 'admindashboard', 'Stock' => 'adminstock');
     $menus = array();
     foreach ($list as $name => $urlname) {
         $menus[] = array('name' => $name, 'urlname' => $urlname, 'created_at' => sqldate(), 'updated_at' => sqldate());
     }
     // Uncomment the below to run the seeder
     DB::table('menus')->insert($menus);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:12,代码来源:MenusTableSeeder.php

示例10: run

 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('role_user')->truncate();
     $list = [1 => 1];
     $roleuser = [];
     foreach ($list as $userid => $roleid) {
         $roleuser[] = ['user_id' => $userid, 'role_id' => $roleid, 'created_at' => sqldate(), 'updated_at' => sqldate()];
     }
     // Uncomment the below to run the seeder
     DB::table('role_user')->insert($roleuser);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:12,代码来源:RoleUserTableSeeder.php

示例11: run

 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('brands')->truncate();
     $list = array('flp' => 'Forever living product', 'sleek' => 'Sleek makeup', 'glamour56' => 'Glamour56 makeup', 'iman' => 'Iman makeup', 'marykay' => 'MaryKay makeup', 'mac' => 'Mac makeup');
     $brands = array();
     foreach ($list as $name => $caption) {
         $brands[] = array('name' => $name, 'caption' => $caption, 'created_at' => sqldate(), 'updated_at' => sqldate());
     }
     // Uncomment the below to run the seeder
     DB::table('brands')->insert($brands);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:12,代码来源:BrandsTableSeeder.php

示例12: run

 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('users')->truncate();
     $list = array('debola1' => 1, 'fresh2' => 2, 'melee3' => 3);
     $users = array();
     foreach ($list as $username => $role) {
         $users[] = array('username' => $username, 'usertoken' => Makehash::random('number', 6), 'password' => Hash::make('demo'), 'created_at' => sqldate(), 'updated_at' => sqldate());
     }
     // Uncomment the below to run the seeder
     DB::table('users')->insert($users);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:12,代码来源:UsersTableSeeder.php

示例13: save

 public function save()
 {
     $r = Input::all();
     $r['date'] = sqldate($r['date']);
     $r['amount'] = unformat_money($r['amount']);
     $r['user_id'] = Auth::user()->id;
     $r['status'] = User::permitted('role.admin') === true ? 1 : 0;
     //Insert into database
     $created = Expenditure::create($r);
     $data['status'] = 'success';
     $data['message'] = 'Record saved successfully!';
     return Response::json($data);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:13,代码来源:ExpenditureController.php

示例14: create

 public function create()
 {
     $all = Input::all();
     $all['user_id'] = Auth::user()->id;
     $all['deposit_date'] = sqldate($all['deposit_date']);
     $all['amount'] = unformat_money($all['amount']);
     $all['status'] = 0;
     //Insert into database
     $created = Bankentry::create($all);
     $data['status'] = 'success';
     $data['message'] = 'saved!';
     return Response::json($data);
 }
开发者ID:sliekasirdis79,项目名称:POS,代码行数:13,代码来源:BankRecordController.php

示例15: tpostsGetsitemap

function tpostsGetsitemap($self, $from, $count)
{
    $result = array();
    $commentpages = litepublisher::$options->commentpages;
    $commentsperpage = litepublisher::$options->commentsperpage;
    $db = $self->db;
    $now = sqldate();
    $res = $db->query("select {$db->posts}.title, {$db->posts}.pagescount, {$db->posts}.commentscount, {$db->urlmap}.url\n  from {$db->posts}, {$db->urlmap}\n  where {$db->posts}.status = 'published' and {$db->posts}.posted < '{$now}' and {$db->urlmap}.id = {$db->posts}.idurl\n  order by {$db->posts}.posted desc limit {$from}, {$count}");
    while ($item = $db->fetchassoc($res)) {
        $comments = $commentpages ? ceil($item['commentscount'] / $commentsperpage) : 1;
        $result[] = array('url' => $item['url'], 'title' => $item['title'], 'pages' => max($item['pagescount'], $comments));
    }
    return $result;
}
开发者ID:laiello,项目名称:litepublisher,代码行数:14,代码来源:posts.class.install.php


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