提交 32372590 编写于 作者: T Terry

product attr service and model

上级 dda8bc72
......@@ -121,6 +121,16 @@ class Attr extends Service
return $this->_attr->remove($ids);
}
protected function actionGetActiveColl($ids)
{
return $this->_attr->remove($ids);
}
public function getActiveAllColl()
{
return $this->_attr->getActiveAllColl();
}
public function getAttrTypes()
{
......@@ -146,6 +156,7 @@ class Attr extends Service
'inputString-Lang' => 'inputString-Lang',
'inputEmail' => 'inputEmail',
'inputDate' => 'inputDate',
'editSelect' => 'editSelect',
'select' => 'select',
];
......
......@@ -100,7 +100,7 @@ class AttrMysqldb extends Service implements AttrInterface
*/
public function save($one)
{
$primaryVal = isset($one[$this->getPrimaryKey()]) ? $one[$this->getPrimaryKey()] : '';
$primaryVal = isset($one[$this->getPrimaryKey()]) ? $one[$this->getPrimaryKey()] : '';
if ($primaryVal) {
$model = $this->_attrModel->findOne($primaryVal);
if (!$model) {
......@@ -141,4 +141,31 @@ class AttrMysqldb extends Service implements AttrInterface
return true;
}
public function getActiveAllColl()
{
// attribute Group
$filter = [
'where' => [
['status' => $this->getEnableStatus()]
],
'fetchAll' => true,
'asArray' => true,
];
$query = $this->_attrModel->find();
$query = Yii::$service->helper->ar->getCollByFilter($query, $filter);
$coll = $query->all();
if (is_array($coll)) {
foreach ($coll as $k => $one) {
if ($one['display_data']) {
$coll[$k]['display_data'] = unserialize($one['display_data']);
}
}
return $coll;
}
return null;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册