本文整理汇总了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);
}
示例2: updateloggedTime
private function updateloggedTime($data)
{
$user = User::find(Auth::user()->id);
$user->isloggedin = $data[0];
$user->loggedtime = sqldate();
$user->save();
}
示例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;
}
示例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);
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}