123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\common\controller;
- use app\BaseController;
- use app\common\middleware\Auth;
- use app\admin\model\Notice as NoticeModel;
- use think\facade\Db;
- /**
- * Description of Tool
- *
- * @author sgq
- */
- class Tool extends BaseController {
- //protected $middleware = [Auth::class];
- public function findChildDictBatch() {
- $result = [];
- for ($i = 0; $i < count($this->request->param()); $i++) {
- if ($obj = $this->request->param($i)) {
- $code = $obj["code"];
- $dict = \app\common\model\Dict::where("code", $code)->findOrEmpty()->toArray();
- $childs = \app\common\model\Dict::where("pid", $dict["id"])->order("num")->select();
- $result[$obj["name"]] = $childs;
- }
- }
- return json(["code" => "200", "msg" => "", "obj" => $result]);
- }
- public function findCommonFileType() {
-
- }
- public function getProvinceSelect() {
- $where = [];
- $where[] = ["code", "like", "%0000"];
- return json(Db::table("un_common_location")->where($where)->select()->toArray());
- }
- public function findCityByProvinceSelect() {
- $code = $this->request->param("code");
- $province_prefix = substr($code, 0, 2);
- return json(Db::table("un_common_location")->where("code", "like", $province_prefix . "%00")->select()->toArray());
- }
- public function findCountyByCitySelect() {
- $code = $this->request->param("code");
- $city_prefix = substr($code, 0, 4);
- return json(Db::table("un_common_location")->where("code", "like", $city_prefix . "%")->select()->toArray());
- }
- }
|