'加油卡', 2 => '话费', 3 => '权益卡', 4 => '卡密类', 5 => 'API业务类' ); public function getType() { return $this->type; } # 根据产品id获取产品 public function getOne($id) { $where['id'] = $id; $where['status'] = 1; $data = $this->db()->where($where)->find(); if ($data) { $data['service'] = $this->getService($data['service_id']); if ($data['service']) { $data['key'] = $data['service']['key']; } else { return false; } } return $data; } # 获取业务 public function getService($id) { $where['id'] = $id; $where['status'] = 1; return $this->app->db->name('service_info')->where($where)->find(); } # 获取所有业务 public function getServiceAll() { $where['status'] = 1; return $this->app->db->name('service_info')->where($where)->select(); } # 获取渠道id public function getProductId($id) { $where['service_id'] = $id; $where['status'] = 1; return $this->app->db->name('channel_product')->where($where)->find(); } # 获取所有产品 public function getAll() { $where['status'] = 1; $data = $this->db()->where($where)->select(); return $data; } }