4 changed files with 53 additions and 18 deletions
-
26app/Admin/Controllers/ImsCjdcMarketController.php
-
18app/Admin/Controllers/LanzuArea.php
-
4app/Admin/routes.php
-
19app/Models/LanzuArea.php
@ -0,0 +1,18 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Admin\Controllers; |
||||
|
|
||||
|
|
||||
|
use Dcat\Admin\Controllers\AdminController; |
||||
|
use \App\Models\LanzuArea as Area; |
||||
|
use Illuminate\Http\Request; |
||||
|
|
||||
|
class LanzuArea extends AdminController |
||||
|
{ |
||||
|
public function getArea(Request $request) |
||||
|
{ |
||||
|
$pid = $request->get('q')??0; |
||||
|
return Area::getArea($pid); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Models; |
||||
|
|
||||
|
|
||||
|
use Illuminate\Database\Eloquent\Model; |
||||
|
|
||||
|
class LanzuArea extends Model |
||||
|
{ |
||||
|
protected $table = 'lanzu_area'; |
||||
|
protected $dateFormat = 'U'; |
||||
|
|
||||
|
public static function getArea($pid=0) |
||||
|
{ |
||||
|
$data = self::where('pid',$pid)->select('id','name as text')->get()->toArray(); |
||||
|
return $data; |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue