提交 1494cd7a 编写于 作者: T Terry

appadmin: 后台可以添加前端商城用户

上级 03002738
......@@ -184,8 +184,8 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
/**
* get edit html bar, it contains add ,eidt ,delete button.
*/
public function getEditBar()
{
return '';
}
//public function getEditBar()
//{
// return '';
//}
}
......@@ -30,6 +30,7 @@ class CustomerRegister extends Customer
{
$parent_rules = parent::rules();
$current_rules = [
['id', 'filter', 'filter' => 'trim'],
['email', 'filter', 'filter' => 'trim'],
['email', 'email'],
['email', 'validateEmail'],
......
......@@ -237,6 +237,13 @@ class Customer extends Service
$primaryKey = $this->getPrimaryKey();
$primaryVal = isset($param[$primaryKey]) ? $param[$primaryKey] : '';
if ($primaryVal) {
$model = $this->_customerRegisterModel;
$model->attributes = $param;
if (!$model->validate()) {
$errors = $model->errors;
Yii::$service->helper->errors->addByModelErrors($errors);
return false;
}
$model = $this->getByPrimaryKey($primaryVal);
if ($model[$primaryKey]) {
unset($param[$primaryKey]);
......@@ -256,6 +263,10 @@ class Customer extends Service
return false;
}
}
} else {
if ($this->register($param)) {
return true;
}
}
return false;
}
......
......@@ -107,8 +107,8 @@ class Product extends Service
$image = $defaultImg;
}
list($price, $special_price) = $this->getPrices($one['price'], $one['special_price'], $one['special_from'], $one['special_to']);
$product_id = '';
$product_id = '';
if (isset($one['product_id']) && $one['product_id']) {
$product_id = (string)$one['product_id'];
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册