<commit_before><?php
namespace Store\Controller;
use Common\Controller\StoreBaseController;
use Store\Model\StoreModel;
use Think\Model;

/**
 * 店铺信息管理
 * @author RockSnap
 *
 */
class InfoController extends StoreBaseController {
	
	/**
	 * 信息资料
	 */
	public function info() {
		$model = new Model('Store');
		$info = $model->find(SID);
		$this->assign('info',$info);
		cookie(C('CURRENT_URL_NAME'),$_SERVER['REQUEST_URI']);
		$this->display();
	}
	/**
	 * 资料更新接口
	 */
	public function infoUpdate() {
		$model = New StoreModel();
		$data = I('post.');
    	if (!empty($_FILES['store_logo'])) {
    		$data['store_logo'] = $_FILES['store_logo'];
    	}
		if (false === $model->myUpdate($data)) {
			$this->error($model->getError());
		}
		$this->success('更新成功',cookie(C('CURRENT_URL_NAME')));
	}
	
}<commit_msg>store/Info 店铺信息 和 筛选属性 的管理<commit_after><?php
namespace Store\Controller;
use Common\Controller\StoreBaseController;
use Store\Model\StoreModel;
use Think\Model;

/**
 * 店铺信息管理
 * @author RockSnap
 *
 */
class InfoController extends StoreBaseController {
	
	/**
	 * 信息资料
	 */
	public function info() {
		$model = new Model('Store');
		$info = $model->find(SID);
		$this->assign('info',$info);
		cookie(C('CURRENT_URL_NAME'),$_SERVER['REQUEST_URI']);
		$this->display();
	}
	/**
	 * 资料更新接口
	 */
	public function update() {
		$model = New StoreModel();
		$data = I('post.');
    	if (!empty($_FILES['store_logo'])) {
    		$data['store_logo'] = $_FILES['store_logo'];
    	}
		if (false === $model->myUpdate($data)) {
			$this->error($model->getError());
		}
		$this->success('更新成功',cookie(C('CURRENT_URL_NAME')));
	}

	/**
	 * 店铺属性查看页面
	 */
	public function attrRead() {
		$map['store_id'] = SID;
		
		$AttrVal_M = new \Manage\Model\AttrValModel();
		$attr_hash = $AttrVal_M->hashList();
		$this->assign('attr_hash',$attr_hash);//属性-属性值 的hash数组
		
		$StoreAttr_M = new \Manage\Model\StoreAttrModel();
		$store_attrs = $StoreAttr_M->where($map)->getField('attr_val_id',true);
		$this->assign('store_attrs',$store_attrs);//该店铺所有的属性值数组
		
		cookie(C('CURRENT_URL_NAME'),$_SERVER['REQUEST_URI']);
		$this->display();
	}
	
	/**
	 * 店铺属性更新接口
	 * @param array $vals	属性值id数组
	 */
	public function attrUpdate($vals=array()) {
		if (!is_array($vals)) $this->error('属性非法');
	
		$model = new \Manage\Model\StoreAttrModel();
		if (false === $model->update(SID, $vals)) $this->error($model->getError());
		$this->success('更新成功');
	}
}
{'fraction_non_alphanumeric': 0.207492795389049, 'fraction_numerical': 0.0, 'mean_word_length': 4.328947368421052, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1081754', 'n_tokens_mistral': 998, 'n_tokens_neox': 963, 'n_words': 137}