【发布时间】:2017-11-24 17:50:46
【问题描述】:
我在 get_where 查询中执行了 result_array(),但 'add_by' 中的列是 json 格式到 {'id': '(the id)'}
如何执行 get_where 查询以匹配当前用户 ID。
这是我目前所拥有的。
$this->db
->order_by('till', 'desc')
->get_where('coupon',
[
'added_by' => json_encode(array('id'=> $this->session->user_id)),
'status' => 'ok'
]
)
->result_array()
【问题讨论】:
标签: php mysql json codeigniter