腾讯K线修复运营版 股票配资系统安装搭建 二次开发 新接口

  • 实盘接口心跳
public static function heart(){
    $heart=new Heart();
    $heart->heart();
    return;
}
  • 预警线= 配资金额+保证金*比例
  • 先搜索 配资表(条件操盘中) 搜子账号ID 去持仓表 查询股票数量 如何数量是0 不继续做判断
  • 搜到的股票数量 用z_market_bat 函数,查询 股票 返回值
   public  function precautious_line(){
 
        if(!yan_time($last_time=15.1)){
            Log::write('非交易时间');
            return;
        }
        $borrow_arr =  Db::name('stock_borrow')->where('status','1')->select();
        if(!empty($borrow_arr)){
            foreach ($borrow_arr as $key=>$val){
                $position_stock_arr = Db::name('stock_position')->where('sub_id',$val['stock_subaccount_id'])->field('gupiao_code,stock_count')->select();
                $market_val= '';
                if(!empty($position_stock_arr)){
                    foreach ($position_stock_arr as $value){
                        $current_price = z_market($value['gupiao_code'])['current_price']; //股票实时价格
                        $market_val += $value['stock_count']*$current_price;  //最新市值
                    }
                }else{
                    continue;
                    //echo "此配资无股票持仓\n\r";
                }
                if(!empty($market_val)){
                    $subaccount_money_arr = Db::name('stock_subaccount_money')->where('stock_subaccount_id',$borrow_arr[$key]
                    ['stock_subaccount_id'])->field('avail,freeze_amount,deposit_money,borrow_money')->find();
                    $subaccount_loss_warn = Db::name('stock_subaccount_risk')->where('stock_subaccount_id',$borrow_arr[$key]
                    ['stock_subaccount_id'])->value('loss_warn');
                    $subaccount_loss_warn= sprintf("%.2f",($subaccount_loss_warn/100));
                    $loss_warn = money_convert($subaccount_money_arr['borrow_money'])+(money_convert($subaccount_money_arr['deposit_money'])*
                            $subaccount_loss_warn);
                    $now_init_amount = $market_val+money_convert($subaccount_money_arr['avail'])+money_convert($subaccount_money_arr
                        ['freeze_amount']);
                    if($now_init_amount<$loss_warn && $borrow_arr[$key]['loss_warn_sms_send']==0){
                        $content = \think\Config::get('sms_template')['stock_loss_warn'];
                        $mobile[$key] = Db::name('member')->where('id',   $borrow_arr[$key]['member_id'])->value('mobile');
                        $content =  str_replace(array("#var#","#order_id#"),array($mobile[$key],$borrow_arr[$key]['order_id']), $content);
                        $res = sendsms_mandao($mobile[$key],$content,'user');
                        if($res){
                            Db::name('stock_borrow')->where('id',$borrow_arr[$key]['id'])->setField('loss_warn_sms_send',1);
                            echo "预警线提醒短信发送成功\n\r";
                        }
                    }else{
                        if($subaccount_money_arr && $loss_warn && $now_init_amount && $borrow_arr[$key]['loss_warn_sms_send']==1){
                            Db::name('stock_borrow')->where('id',$borrow_arr[$key]['id'])->setField('loss_warn_sms_send',0);
                            echo "该配资没有低于预警线\n\r";
                        }
                    }
                }else{
                    echo "最新总市值获取失败\n\r";
                }
            }
        }else{
            echo "无配资记录\n\r";
        }
    }

更新了腾讯的股票数据接口,修复实时行情数据,重构行情K线接口,分时,日K

修复手机端 涨跌榜显示异常

优化手机端页面,解决手机端加载慢的问题




这个是电脑端个股持仓的分时图截图
腾讯K线修复运营版 股票配资系统安装搭建 二次开发 新接口_第1张图片
周K数据、买入卖出截图
腾讯K线修复运营版 股票配资系统安装搭建 二次开发 新接口_第2张图片
用户个人中心、资金情况
腾讯K线修复运营版 股票配资系统安装搭建 二次开发 新接口_第3张图片

免费体验配资控制器

class Mock extends Home
{
	public function index()
	{
	    $money=config('web_site_mock');
		$this->assign('money', $money);
		$this->assign('title', '模拟操盘-股票配资');
		return $this->fetch();
	} 
}

免息配资

 public function free()
    {
        $DivideInto =explode('|', config('free_set'))[2].'%';;
        $day_position = json_encode(config('day_position'));
        $this->assign('free_loss', explode('|', config('free_loss'))); //预警线|平仓线(按天)
        $this->assign('free_set', explode('|', config('free_set'))); //免息设置
        $this->assign('DivideInto', $DivideInto);
        $this->assign('day_position', $day_position);
        return $this->fetch();
    }

按周配资

  public function week()
    {
        $week_use_time = explode('|', config('week_use_time')); // 按周操盘期限
        $max_use_time = max($week_use_time); // 最大使用时间
        $min_use_time = min($week_use_time); // 最短使用时间
        //单股持仓比例
        $week_position = json_encode(config('week_position'));
        $this->assign('week_loss', explode('|', config('week_loss'))); //预警线|平仓线(按月)
        $this->assign('week_rate', config('week_rate')); // 倍率及费率
        $this->assign('week_use_time', $week_use_time);
        $this->assign('max_use_time', $max_use_time);
        $this->assign('min_use_time', $min_use_time);
        $this->assign('week_position', $week_position);

        return $this->fetch();
    }

二次开发 安装搭建 QQ扫一扫:
腾讯K线修复运营版 股票配资系统安装搭建 二次开发 新接口_第4张图片

你可能感兴趣的:(大数据,小程序,elasticsearch,腾讯云,阿里云,php,mysql)