| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace app\common\model;
- use app\common\model\BaseModel;
- use think\db\Query;
- /**
- * 钉钉机器人
- *
- * @Author Mark
- * @DateTime 2024-08-09
- */
- class DtalkRobot extends BaseModel
- {
- protected $name = 'dtalk_robot';
- /**
- * [detail]
- *
- * @Author: Yeshihao
- * @DateTime: 2024/8/9 17:26
- * @param $id
- * @return DtalkRobot|null
- * @throws \think\exception\DbException
- */
- public static function detail($id)
- {
- return static::get($id);
- }
- /**
- * [handlerSearch]
- * 搜索器
- * @Author: Yeshihao
- * @DateTime: 2024/8/9 17:26
- * @param Query $query
- * @param array $param
- * @return Query
- */
- public function handlerSearch(Query $query, array $param)
- {
- //应用名称
- if (!empty($param['name'])) {
- $query->where('name', 'like', "%".$param['name']."%");
- }
- return $query;
- }
- /**
- * 删除记录
- * @return int
- * @throws \think\Exception
- * @throws \think\exception\PDOException
- */
- public function setDelete()
- {
- return $this->save(['is_delete' => 1]);
- }
- }
|