12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace app\admin\model;
- use think\facade\Db;
- use think\model;
- class Appointment extends model
- {
- public function add($param){
- $param["sponsor_id"] = get_login_admin("id");
- $param["sponsor_name"] = get_login_admin("nickname");
- $param["sponsor_unit"] = get_login_admin("unit_name");
- $param["create_time"] = time();
- $param["update_time"] = time();
- return $this->save($param);
- }
-
-
- public function agree($param){
- $data = $this->find($param["id"]);
- $unit = get_login_admin("unit_name");
- $another = get_admin($data["sponsor_id"])["unit_name"];
- if($data!=null ){
- $param["approval_id"] = get_login_admin("id");
- $param["approval_name"] = get_login_admin("nickname");
- $param["audit_status"] = 1;
- $param["update_time"] = time();
- return $this->update($param);
- }
-
- return false;
- }
-
-
- public function disagree($param){
- $data = $this->find($param["id"]);
- $unit = get_login_admin("unit_name");
- $another = get_admin($data["sponsor_id"])["unit_name"];
- if($data!=null && $unit!=$another){
- $param["approval_id"] = get_login_admin("id");
- $param["approval_name"] = get_login_admin("nickname");
- $param["audit_status"] = 2;
- $param["update_time"] = time();
- return $this->update($param);
- }
- return false;
- }
-
- }
|