123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?php
- /*
- * @Author: wang jun
- * @Date: 2022-01-18 11:12:23
- * @Last Modified by: wang jun
- * @Last Modified time: 2022-01-19 15:51:59
- */
- namespace app\admin\logic;
- use app\admin\model\companymodel;
- use app\admin\model\partymodel;
- use app\admin\model\partyrecordmodel;
- use app\admin\model\usermodel;
- class homelogic extends baselogic
- {
- /**
- * 设置请求数据规则
- * 20220107
- * wj
- */
- protected function setrules()
- {
- $list = [];
- return $list;
- }
- /**
- * 获取活动信息
- * 20220211
- * wj
- */
- public function getpartyinfo($arr)
- {
- $result = $this->checkparam(__FUNCTION__, $arr);
- if (1 != $result['status']) {
- return $result;
- }
- $m_p = new partymodel();
- //总数
- $count = $m_p->getList([], 'count');
- //当前活动
- $time = date('Y-m-d H:i:s');
- $where = [
- ['isactive', '=', 1],
- ['start_time', '<=', $time],
- ['end_time', '>=', $time],
- ];
- $info = $m_p->getInfo($where, ['name', 'id']);
- //报名企业数量
- $wherePr = [
- 'party_id' => $info['id'],
- ];
- $m_p = new partyrecordmodel();
- $prcount = $m_p->getListjoincompany($wherePr, 'count');
- $data = [
- 'count' => $count,
- 'info' => $info,
- 'prcount' => $prcount,
- ];
- return backarr(1, '查询成功', $data);
- }
- /**
- * 获取公司信息
- * 20220211
- * wj
- */
- public function getcompanyinfo($arr)
- {
- $result = $this->checkparam(__FUNCTION__, $arr);
- if (1 != $result['status']) {
- return $result;
- }
- $m_c = new companymodel();
- //总数
- $count = $m_c->getList([], 'count');
- //获取分组
- $where0 = ['ispass' => 0];
- $where1 = ['ispass' => 1];
- $where2 = ['ispass' => 2];
- $count0 = $m_c->getList($where0, 'count');
- $count1 = $m_c->getList($where1, 'count');
- $count2 = $m_c->getList($where2, 'count');
- $data = [
- 'count' => empty($count) ? 0 : $count,
- 'count0' => empty($count0) ? 0 : $count0,
- 'count1' => empty($count1) ? 0 : $count1,
- 'count2' => empty($count2) ? 0 : $count2,
- ];
- return backarr(1, '查询成功', $data);
- }
- /**
- * 获取用户信息
- * 20220211
- * wj
- */
- public function getuserinfo($arr)
- {
- $result = $this->checkparam(__FUNCTION__, $arr);
- if (1 != $result['status']) {
- return $result;
- }
- $m_u = new usermodel();
- //总数
- $count = $m_u->getList([], 'count');
- //获取分组
- $where1 = ['is_active' => 1];
- $where2 = ['company_id' => 1];
- $count1 = $m_u->getList($where1, 'count');
- $count2 = $m_u->getList($where2, 'count');
- $count1 = empty($count1) ? 0 : $count1;
- $count2 = empty($count2) ? 0 : $count2;
- $data = [
- 'count' => empty($count) ? 0 : $count,
- 'count_isactive_0' => $count - $count1,
- 'count_isactive_1' => $count1,
- /*'couunt_iscompany_0' => $count - $count2,
- 'couunt_iscompany_1' => $count2,*/
- ];
- return backarr(1, '查询成功', $data);
- }
- }
|