<?php
/*
 本代码由 焕岱科技 创建
 技术支持 WX：15285007200
 严禁反编译、逆向等任何形式的侵权行为，违者将追究法律责任
*/

namespace app\api\controller\scoreshop;

use app\api\controller\Base;
use think\Db;
use app\common\model\bbfxshop\User;


class Index extends Base
{
    protected $noNeedLogin = ['index','getRecommendGoods'];
    protected $noNeedRight = ['*'];
    
    public $model = null;
    public function _initialize(){
        parent::_initialize();
        $this->model = new \app\common\model\bbfxshop\Scoreshop;
    }
    
    public function getRecommendGoods(){
        $params = $this->param();
        
        $list = Db::name("bbfx_scoreshop_goods")->where(['uniacid'=>UNIACID,'is_recommend'=>1,'status'=>1])->order('sort desc')->select();
        
        if(empty($list)){
            $list = [];
        }
        
        foreach ($list as $key => &$val){
            $val['thumb'] = cdnurl($val['thumb']);
            $val['o_price'] = floatval($val['o_price']);
        }
        unset($val);
        
        __success("操作成功",$list);
    }
}