<?php
/**
 * 我的反馈
 *
 *
 *
 *

 */

//use Shopnc\Tpl;

defined('InShopNC') or exit('Access Invalid!');

class member_feedbackControl extends mobileControl
{
    public function __construct()
    {
        parent::__construct();
    }

    public function pageOp()
    {
        self::outsuccess(NULL,'shop/feedback','wap');
    }
    public function addOp()
    {
        $mb_feedback = Model('mb_feedback');

        $param = array();
        $param['content'] = urldecode($_POST['feedback']);
        $param['type'] = $_SESSION['client_type'];
        $param['ftime'] = time();

        if($_SESSION['is_login'] == 1) {
            $param['member_id'] = $_SESSION['member_id'];
            $param['member_name'] = $_SESSION['member_name'];
        } else {
            $param['member_name'] = (isset($_GET['mobile']) && !empty($_GET['mobile'])) ? $_GET['mobile'] : '';
        }

        $result = $mb_feedback->addMbFeedback($param);

        if ($result) {
            self::outsuccess(NULL);
        } else {
            self::outerr('保存失败');
        }
    }
}
