提交 1dd6deba 编写于 作者: T Terry

后台删除customer报错的bug

上级 193f9f9c
......@@ -135,6 +135,9 @@ class ProductController extends AppserverController
foreach($custom_option as $attr => $one){
if($attr && isset($one['image']) && $one['image']){
$one['image'] = Yii::$service->product->image->getResize($one['image'],[40,45],false);
if($price = $one['price']){
$one['price'] = Yii::$service->page->currency->getCurrentCurrencyPrice($price);
}
$arr[$attr] = $one;
}
}
......
......@@ -425,6 +425,34 @@ class Customer extends Service
'count'=> $query->limit(null)->offset(null)->count(),
];
}
/**
* @property $id | String 主键值
* 通过主键值找到分类,并且删除分类在url rewrite表中的记录
* 查看这个分类是否存在子分类,如果存在子分类,则删除所有的子分类,以及子分类在url rewrite表中对应的数据。
*/
public function remove($id)
{
if (!$id) {
Yii::$service->helper->errors->add('remove id is empty');
return false;
}
$model = $this->_customerModel->findOne($id);
if (isset($model[$this->getPrimaryKey()]) && !empty($model[$this->getPrimaryKey()])) {
$model->delete();
} else {
Yii::$service->helper->errors->add("customer Remove Errors:ID:$id is not exist.");
return false;
}
return true;
}
/**
* @property $user_ids | Array , 子项为Int类型
* @return Array ,数据格式为:
......
......@@ -113,7 +113,7 @@ class Currency extends Service
protected function actionGetCurrentCurrencyPrice($price)
{
$currencyCode = $this->getCurrentCurrency();
$currencyPrice = $this->GetCurrencyPrice($price,$currencyCode);
$currencyPrice = $this->getCurrencyPrice($price,$currencyCode);
if($currencyPrice){
return $currencyPrice;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册