微擎多图片上传

//html代码
                    <div class="fui-uploader fui-uploader-sm" data-max="5" data-count="0">
                        <input type="file" name='imgFile0[]' id='imgFile0' multiple="" accept="image/*" >
                    </div>
//php代码
$comments = $_GPC['comments'];

        foreach ($comments as $c ) 
        {

            var_dump($c);
            $old_c = pdo_fetchcolumn('select count(*) from ' . tablename('ewei_shop_creditshop_comment') . "\r\n" . '            where uniacid=:uniacid and logid=:logid and goodsid=:goodsid limit 1', array(':uniacid' => $_W['uniacid'], ':goodsid' => $c['goodsid'], ':logid' => $logid));
            if (empty($old_c)) 
            {
                $comment = array('uniacid' => $uniacid, 'logid' => $logid, 'logno' => $log['logno'], 'goodsid' => $c['goodsid'], 'level' => $c['level'], 'content' => trim($c['content']), 'images' => (is_array($c['images']) ? iserializer($c['images']) : iserializer(array())), 'openid' => $openid, 'nickname' => $member['nickname'], 'headimg' => $member['avatar'], 'time' => time(), 'checked' => $checked);
                pdo_insert('ewei_shop_creditshop_comment', $comment);
            }
            else 
            {
                $comment = array('append_content' => trim($c['content']), 'append_images' => (is_array($c['images']) ? iserializer($c['images']) : iserializer(array())), 'append_checked' => $checked, 'append_time' => time());
                pdo_update('ewei_shop_creditshop_comment', $comment, array('uniacid' => $_W['uniacid'], 'goodsid' => $c['goodsid'], 'logid' => $logid));
            }
        }

 

posted @ 2019-11-08 11:10  大熊童鞋  阅读(1553)  评论(0编辑  收藏  举报