我正在通过过滤器进行产品搜索:
我的代码:
->where(function($query) use($filter)
{
if(!empty($filter)){
foreach ($filter as $key => $value) {
$f = explode(",", $value);
$query-> whereIn('products.value', $f);
}
}
})
Run Code Online (Sandbox Code Playgroud)
查询:
and (products.value in (Bomann, PHILIPS) and products.value in (red,white))
Run Code Online (Sandbox Code Playgroud)
但是我需要:
and (products.value in (Bomann, PHILIPS) OR products.value in (red,white))
Run Code Online (Sandbox Code Playgroud)
Laravel有类似的东西:
orWhereIn
Run Code Online (Sandbox Code Playgroud) 我像这样使用jQuery Image上传http://blueimp.github.com/jQuery-File-Upload/
我得到了缩略图,点击上传按钮后我得到了进度条,但后来得到'SyntaxError:JSON.parse:unexpected character'
查看页面
</body>
</html>
<head>
<meta charset="utf-8">
<title>jQuery File Upload Demo</title>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.css">
<!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-ie6.min.css"><![endif]-->
<link rel="stylesheet" href="http://blueimp.github.com/jQuery-File-Upload/jquery.fileupload-ui.css">
<style type="text/css">body {padding-top: 80px;}</style>
<meta name="description" content="File Upload widget with multiple file selection, drag&drop support, progress bar and preview images for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file …Run Code Online (Sandbox Code Playgroud) 我想从Codeigniter邮件类发送电子邮件,附件img和img在邮件正文中.
$this->email->from('office@office.com', 'Email');
$this->email->to('aaa@aaa.com');
$this->email->attach('pic.png');
$this->email->set_mailtype("html");
$this->email->subject('Email');
$this->email->message('<img src="??????" />');
$this->email->send();
Run Code Online (Sandbox Code Playgroud)
Img是附件,但不是邮件.有帮助吗?