| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace app\index\controller;
- /**
- * 智能问答类
- */
- class Robot extends Common
- {
- /**
- * 热点智能问答筛选
- *
- * @access public
- * @return array JsonString
- */
- public function index()
- {
- $code = -2;
- $msg = '错误';
- try {
- // 获取查询条件.
- $groupsId = input('get.groups_id');
- $robotgroups_id = input('get.robotgroups_id');
- if ($groupsId) {
- $robotWhere['groups_id'] = $groupsId;
- }
- if ($robotgroups_id) {
- $robotWhere['robotgroups_id'] = $robotgroups_id;
- }
- $robotWhere['robot_status'] = 1;
- $robotWhere['robot_host'] = 1;
- // 获取符合条件数据.
- $robot = model('Robot')->select($robotWhere);
- return json(['code' => 200, 'data' => $robot, 'msg' => '成功']);
- } catch (\Exception $e) {
- return json(['code' => $code, 'data' => [], 'msg' => $msg]);
- }//end try
- }//end index()
- /**
- * 智能问答分组
- *
- * @access public
- * @return array JsonString
- */
- public function getRobotGroups()
- {
- $code = -2;
- $msg = '错误';
- try {
- $robotGroupsWhere['robotgroups_status'] = 1;
- // 获取符合条件数据.
- $robotGroups = model('Robotgroups')->select($robotGroupsWhere);
- return json(['code' => 200, 'data' => $robotGroups, 'msg' => '成功']);
- } catch (\Exception $e) {
- return json(['code' => $code, 'data' => [], 'msg' => $msg]);
- }
- }//end getRobotGroups()
- }
|