fix contact index
This commit is contained in:
parent
e5d51dff86
commit
cfb6fda288
@ -20,7 +20,7 @@ class Contact extends Controller {
|
|||||||
|
|
||||||
public function index() {
|
public function index() {
|
||||||
$model = new ContactModel();
|
$model = new ContactModel();
|
||||||
$rows = $model->getContactsWithDetail();
|
$rows = $model->getContacts();
|
||||||
|
|
||||||
if (empty($rows)) {
|
if (empty($rows)) {
|
||||||
return $this->respond([
|
return $this->respond([
|
||||||
|
|||||||
@ -10,6 +10,9 @@ use App\Models\CounterModel;
|
|||||||
class PatVisit extends Controller {
|
class PatVisit extends Controller {
|
||||||
use ResponseTrait;
|
use ResponseTrait;
|
||||||
|
|
||||||
|
protected $db;
|
||||||
|
protected $visnum_prefix;
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->db = \Config\Database::connect();
|
$this->db = \Config\Database::connect();
|
||||||
$this->visnum_prefix = "DV";
|
$this->visnum_prefix = "DV";
|
||||||
|
|||||||
@ -18,6 +18,11 @@ class ContactModel extends Model {
|
|||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getContacts() {
|
||||||
|
$rows = $this->select("ContactID, NameFirst, NameLast, Title, Initial, Specialty")->get()->getResultArray();
|
||||||
|
return $rows;
|
||||||
|
}
|
||||||
|
|
||||||
public function getContactWithDetail($ContactID) {
|
public function getContactWithDetail($ContactID) {
|
||||||
$rows = $this->where('contact.ContactID', $ContactID)->join('contactdetail cd', 'contact.ContactID=cd.ContactID','left')->get()->getResultArray();
|
$rows = $this->where('contact.ContactID', $ContactID)->join('contactdetail cd', 'contact.ContactID=cd.ContactID','left')->get()->getResultArray();
|
||||||
$contact = [
|
$contact = [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user