Basemsg.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\admin\controller;
  3. use app\api\BaseController;
  4. use think\App;
  5. use think\facade\Db;
  6. use think\facade\View;
  7. class Basemsg extends BaseController
  8. {
  9. public function __construct(App $app)
  10. {
  11. parent::__construct($app);
  12. $this->uid = get_login_admin('id');
  13. //0是财,1是送审,2是公司
  14. $this->unit_type = Db::name("department")->where("id",get_login_admin("unit_name"))->value("type");
  15. }
  16. public function index(){
  17. $detail = Db::name("department")->where("id",get_login_admin("unit_name"))->find();
  18. View::assign("detail",$detail);
  19. View::assign("unit_type",$this->unit_type);
  20. return view();
  21. }
  22. public function edit(){
  23. if (request()->isAjax()) {
  24. $param = get_params();
  25. $param["update_time"] = time();
  26. Db::name("department")->where("id",get_login_admin("unit_name"))->update($param);
  27. return to_assign(0,'操作成功');
  28. // halt($param);
  29. }
  30. }
  31. }