我想开发员工时钟输入和输出系统(网站).
我担心两件事:
如果工作人员从昨天开始忘记"闹钟"并且今天有'时钟输入',那么它应该标记给经理.
工作人员可能会长时间工作,例如:时钟周一上午11:00到周二上午01:30(午夜后).我不希望系统认为工作人员已经忘记了时钟..
如何解决这个问题以及数据库设计可以改进哪些方面?
员工表:
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(50) | NO | | NULL | |
| password | varchar(50) | NO | | NULL | |
| hourly_rate | decimal(6,2) | NO | | NULL | |
+-------------+--------------+------+-----+---------+----------------+
Run Code Online (Sandbox Code Playgroud)
时钟表:
+----------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | …Run Code Online (Sandbox Code Playgroud) 如何正确排序用户名?
例如,我执行此查询:
SELECT * FROM `members` WHERE username LIKE 'bx%' ORDER BY username ASC
Run Code Online (Sandbox Code Playgroud)
结果:
bx1
bx10
bx11
bx12
bx13
bx14
bx15
bx16
bx17
bx18
bx19
bx2
bx20
bx21
bx3
bx4
bx5
Run Code Online (Sandbox Code Playgroud)
我想这样回来:
bx1
bx2
bx3
bx4
bx5
...
bx15
bx16
Run Code Online (Sandbox Code Playgroud)
等等
<label>Title</label>和<select>字段之间有一个小的差距,我无法弄清楚是什么原因造成的?
访问http://jsfiddle.net/xrvbv/6/,您会发现<select>没有正确对齐.
CSS:
.FormStyle label {
display: inline-block;
width: 130px;
text-align: right;
padding-right: 7px;
font-size: 11px;
color: #666;
font-weight: bold;
}
.FormStyle input[type="text"], .FormStyle textarea {
padding: 3px;
display: inline-block;
width: 290px;
border: 1px solid #BDC7D8;
border-image: initial;
margin: 0px;
font-size: 12px;
}
.FormStyle li {
padding: 3px;
margin-bottom: 1px;
}
.FormStyle {
margin: 5px 0px 0px;
padding: 0px 0px 10px;
list-style-type: none;
border-bottom: 1px solid #E5E5E5;
}?
Run Code Online (Sandbox Code Playgroud)
HTML
<ul class="FormStyle">
<li>
<label>First …Run Code Online (Sandbox Code Playgroud) 我想将网站从PSD原型转换为HTML/CSS/Bootstrap,然后转向JavaScript开发并使用React.js和一些JavaScript编码.
是否可以在不使用React-Bootstrap的情况下将纯Bootstrap与React.js一起使用?
还有可能HTML/CSS Freelancer只能将React-Bootstrap作为模型,然后找到一个JavaScript开发人员来完成像React.js和JS开发这样的高级工作吗?
我想使用电子和混合应用程序使用相同的代码库开发桌面应用程序.
在TokenRepository你可以看到3种类似的方法.它创建了令牌表的新条目,但每个方法都有不同的字段.
我怎么能重构这个?我应该将3种方法合并为1种方法还是应该使用策略模式?
TokenRepository类:
class TokenRepository
{
public function createTokenDigitalOcean(User $user, $name, $accessToken, $refreshToken = null)
{
return $user->tokens()->create([
'name' => $name,
'provider' => 'digital_ocean',
'access_token' => $accessToken,
'refresh_token' => $refreshToken,
]);
}
public function createTokenLinode(User $user, $name, $key)
{
return $user->tokens()->create([
'name' => $name,
'provider' => 'linode',
'linode_key' => $key,
]);
}
public function createTokenAws(User $user, $name, $key, $secret)
{
return $user->tokens()->create([
'name' => $name,
'provider' => 'aws',
'aws_key' => $key,
'aws_secret' => $secret,
]);
}
}
Run Code Online (Sandbox Code Playgroud)
我有3个类 …
如果three找到,那么它应该返回true并停止迭代.否则返回false如果找不到则返回false.
我正在使用filter()- 这是错误的使用方法吗?
var data = [
'one',
'two',
'three',
'four',
'three',
'five',
];
found = data.filter(function(x) {
console.log(x);
return x == "three";
});
console.log(found);
Run Code Online (Sandbox Code Playgroud)
我原以为输出会是:
但实际输出是: ""
$condition = true;
$categoryId = 123;
$result = 'http://domain.dev/category' . empty($condition) ? '' : '/' . $categoryId;
var_dump($result);
Run Code Online (Sandbox Code Playgroud)
从我的理解-它是否empty($condition)是空的-如果为true,则追加http://domain.dev/category与''要不然/$categoryId
我做错了什么?
如果作业失败,它将被推回队列。有没有办法在再次处理作业时记住作业类中的属性值?
例如:
class MailJob extends Job
{
public $tries = 3;
public $status;
public function __construct()
{
$this->status = false; // set to false
}
/**
* Execute the job.
*/
public function handle()
{
$this->status = true;
// Assume job has failed, it went back to the Queue.
// status should be true when this job start processing again
}
}
Run Code Online (Sandbox Code Playgroud) 如何使用 Jest 进行测试return
例如使用 Lambda:
exports.handler = async (event, context, callback) => {
try {
const orders = await getOrders();
if (!orders) {
console.log("There is no Orders");
return; //<< How do test this?
}
// Something else
} catch (err) {
throw new;
}
};
Run Code Online (Sandbox Code Playgroud)
我能够测试控制台日志,但我也喜欢测试return预期
目前我在测试中使用这个:
it("should terminate if there is no order", async () => {
console.log = jest.fn();
let order = await func.handler();
expect(console.log.mock.calls[0][0]).toBe('There is no Orders');
});
Run Code Online (Sandbox Code Playgroud) php ×4
javascript ×3
database ×2
laravel ×2
laravel-5 ×2
mysql ×2
css ×1
date ×1
date-format ×1
jestjs ×1
laravel-5.4 ×1
logic ×1
node.js ×1
reactjs ×1
sql ×1