12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace app\api\model;
- use think\facade\Db;
- use think\Model;
- /**
- * Created by PhpStorm
- * Author: ihavoc
- * Date: 2020/11/22
- * Time: 16:24
- *
- */
- class Orgs extends Model {
- protected $table = 't_orgs';
- protected $pk = 'id';
- //添加任务 返回添加数据的主键id
- public function createOrgsInfo($data)
- {
- return $this->insertAll($data);
- }
- //连表查询对应的ccjc信息
- public function selectCcjcData($where,$pageNum=1,$pageSize=10)
- {
- $result= Db::name("orgs")
- ->join('t_ccjc','t_orgs.task_id=t_ccjc.id')
- ->where($where)
- ->page((int)$pageNum,(int)$pageSize)
- ->select();
- return $result;
- }
- public function countCcjcData($where)
- {
- $result= Db::name("orgs")
- ->Join('t_ccjc','t_orgs.task_id=t_ccjc.id')
- ->where($where)
- ->count();
- return $result;
- }
- }
|