我的控制器包含:
public function winner_bidder(){
$pro_id=$this->input->get(pro_id);
$data = $this->indexModel->winner_bidder($pro_id);
echo json_encode($data); }
我的模特是:
public function winner_bidder($pro_id){
$q=$this->db->query(SELECT *,MAX(bid_price) AS bid_price FROM
bid WHERE product_id = $pro_id);
$check = $q->result_array();
foreach($check as $result){
$user_id =$result['user_id'];
}
if($check){
$s = $this->db->select(*)
->where(user_id,$user_id)
->get(users);
$s = $s->result_array();
}
return $arrayName = array('bid_data' =>$check,'users_data'=>$s);
}
鉴于我正在接收该数据
success:function(data){}
如何通过该成功函数接收数据。如果有任何组合查询的方法,也请参考该解决方案。