alias('vcr') ->join('ls_retail_vip_card as vc on vc.id=vcr.' . $this::VIP_CARD_ID) ->join('ls_retail_vip as v on v.id=vcr.' . $this::VIP_ID) ->field($field) ->where($map) ->page(intval($page),intval($limit)) ->order($order) ->select(); return $data; } /** * 三表统计 核销记录表 次卡表 会员表 * @param $map array 条件 * @return int */ public function totalVipCardRecord($map) { $total= $this->alias('vcr') ->join('ls_retail_vip_card as vc on vc.id=vcr.' . $this::VIP_CARD_ID) ->join('ls_retail_vip as v on v.id=vcr.' . $this::VIP_ID) ->where($map) ->count(); return $total; } }