前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >swap自动交易机器人系统开发代码呈现案列讲解

swap自动交易机器人系统开发代码呈现案列讲解

原创
作者头像
达见危Gb16978
发布2022-07-27 15:30:17
5320
发布2022-07-27 15:30:17
举报
文章被收录于专栏:软件开发讲解

swap自动交易机器人代码呈现案列讲解:

代码语言:javascript
复制
  public function cattype()
    {
        $result = array('code' => 0, 'msg' => '', 'data' => array('list' => null));
        $this->_checkOpen();
        // if (!IS_POST) {
        //     $result['msg'] = '非法请求';
        //     $this->ajaxReturn($result);
        // }

        $type_id    = I('typeid', '0', 'intval');
        $level      = I('level', 'self'); //self 自己(默认),top 顶级,parent父级
        $num_flag   = I('numflag', 0, 'intval'); //显示对应文档数
        $field_flag = I('fieldflag', 0, 'intval'); //显示content
        $field_flag = empty($field_flag) ? 0 : 1;

        $_category_all = get_category(0);
        if ($level == 'parent') {
            $cattype = Category::getParent($_category_all, $type_id, 1);
        } else if ($level == 'top') {
            $cattype = Category::getParent($_category_all, $type_id, 2);
        } else {
            $cattype = Category::getSelf($_category_all, $type_id);
        }

        if (!empty($cattype)) {
            $cattype['url'] = get_url($cattype);
            $cattype['url'] = $this->getCateUrl($this->is_mobile, $cattype, false, ''); //($catlist);

            if (isset($cattype['cat_pic'])) {
                if (empty($cattype['cat_pic'])) {
                    $cattype['cat_pic'] = '';
                } else if (stripos($cattype['cat_pic'], 'http://') === false && stripos($cattype['cat_pic'], 'https://') === false) {
                    $cattype['cat_pic'] = $this->getDomain() . $cattype['cat_pic'];
                }
            }

            if ($num_flag) {
                $cattype['arc_num'] = get_category_count($cattype['id']);
            } else {
                $cattype['arc_num'] = 0;
            }

            if ($field_flag) {
                $cattype['content'] = M('Category')->where(array('id' => $cattype['id']))->getField('content');
            }

        } else {
            $cattype = null;
        }

        $result['code']         = 1;
        $result['data']['list'] = $cattype;
        $this->ajaxReturn($result);

    }

swap自动交易机器人是如何完成工作的,通过什么样的方式来实现功能,要怎么样才能够最大化的发挥他的能力已经功能,以上代码知识一部分内容,需要大家更加详细的去开挖掘。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
作者已关闭评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档