小编Lak*_*aky的帖子

Laravel其中在OR whereIn

我正在通过过滤器进行产品搜索:

我的代码:

->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)

php mysql query-builder laravel laravel-4

23
推荐指数
5
解决办法
9万
查看次数

jQuery图像上传 - CodeIgniter

我像这样使用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&amp;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)

php jquery codeigniter

5
推荐指数
1
解决办法
9511
查看次数

与CodeIgniter的PHP邮件附件

我想从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是附件,但不是邮件.有帮助吗?

php email codeigniter

1
推荐指数
1
解决办法
2524
查看次数

标签 统计

php ×3

codeigniter ×2

email ×1

jquery ×1

laravel ×1

laravel-4 ×1

mysql ×1

query-builder ×1