switch(值){ 开始case 值: 闭合break; }

          switch ($goods['leixing']) {
                    case 1:
                        $data['type'] = 1;
                        $data['orderid'] = 'PT' . rand(000000, 999999) . time();
                        break;
                    case 2:
                        $data['type'] = 2;
                        $data['orderid'] = 'WP' . rand(000000, 999999) . time();
                        break;
                    case 3:
                        $data['type'] = 3;
                        $data['orderid'] = 'CT' . rand(000000, 999999) . time();
                        break;
                }

 

posted @ 2017-10-25 13:59  遇事稳坐钓鱼台  阅读(277)  评论(0编辑  收藏  举报