Giter Site home page Giter Site logo

lottery-applet's Introduction

-

微信小程序:采用vant组件 用途:公司年会抽奖 用户中奖一次后将不会再参与抽奖

sql文件在项目根目录 导入即可 我后端用的php 查询出的数据转一维度数组就好了 数组例:["张三","李四"]

停止后会触发接口 修改中奖人的中奖状态 也就是sql中的isok字段

下面是两个小程序触发的接口 直接贴下面了【命名比较随便 赶工写的 直接上的助手函数】

        public function getokuser(){
        $userok = db('okuser')->where('isok',0)->field("username")->select();
        $last_names = array_column($userok, 'username');
        return json($last_names);
        }
        
        public function iosoksr(){
            
            $count = db('okuser')->where('isok',0)->orderRaw('rand()')->find();
            
            $isok = db('okuser')->where('id',$count['id'])->update(['isok'=>1]);
            if($isok)return json($count['username']);
            
        }

长这样!

Image text Image text Image text

By-Daixs

lottery-applet's People

Contributors

daixs020 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.