Backend Model

This commit is contained in:
DESKTOP-GBA0BK8\Admin
2023-04-16 14:05:55 -04:00
parent 77c7cbb354
commit 5046454b73
2 changed files with 11 additions and 5 deletions
+10 -4
View File
@@ -24,7 +24,7 @@ class WrenchApi extends BaseController
} }
public function apigate(){ public function apigate(){
/*
//$request = service('request'); //$request = service('request');
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');
//header("Access-Control-Allow-Origin: http://localhost:9057 "); //header("Access-Control-Allow-Origin: http://localhost:9057 ");
@@ -33,7 +33,7 @@ class WrenchApi extends BaseController
//header("Access-Control-Allow-Headers: Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With"); //header("Access-Control-Allow-Headers: Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With");
header('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS'); header('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS');
header('Content-type: application/json'); header('Content-type: application/json');
*/
// what is the endpoint // what is the endpoint
$uri = urldecode(current_url(true)); $uri = urldecode(current_url(true));
$findme = '?'; $findme = '?';
@@ -296,8 +296,14 @@ class WrenchApi extends BaseController
$in["pid"] = 100; $in["pid"] = 100;
$out = array(); $out = array();
if ( $call_backend == true){ if ( $call_backend == true){
$wrenchboard = new \App\Models\BackendModel();
$ret = $wrenchboard->wrenchboard_api($in, $out); $this->load->model('BackendModel');
$out = array();
$ret = $this->BackendModel->wrenchboard_api($in, $out);
// $wrenchboard = new \App\Models\BackendModel();
// $ret = $wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = 0; // $ret; // this is reserved array parameter - to be captured and received before you use the out array() $out['internal_return'] = 0; // $ret; // this is reserved array parameter - to be captured and received before you use the out array()
} }
else else
+1 -1
View File
@@ -6,7 +6,7 @@ class BackendModel extends Model
{ {
const DEBUG_API_CALLS = true; const DEBUG_API_CALLS = true;
public $wrenchboard; private $wrenchboard; // internal use only - no overriding
public $USER = 'root'; public $USER = 'root';
public function __construct() public function __construct()
{ {