11
This commit is contained in:
+3
-3
@@ -37,21 +37,21 @@ class Thali extends Base
|
||||
*/
|
||||
public function getMonthPriceAttr($value,$row)
|
||||
{
|
||||
return bcmul($row['price'],$row['month_discount'],2);
|
||||
return round(bcmul($row['price'],$row['month_discount'],2));
|
||||
}
|
||||
/**
|
||||
* 季价
|
||||
*/
|
||||
public function getQuarterPriceAttr($value,$row)
|
||||
{
|
||||
return bcmul($row['price'],$row['quarter_discount'],2);
|
||||
return round(bcmul($row['price']*3,$row['quarter_discount'],2));
|
||||
}
|
||||
/**
|
||||
* 年价
|
||||
*/
|
||||
public function getYearPriceAttr($value,$row)
|
||||
{
|
||||
return bcmul($row['price'],$row['year_discount'],2);
|
||||
return round(bcmul($row['price']*12,$row['year_discount'],2));
|
||||
}
|
||||
function Role(){
|
||||
return $this->hasOne('UserRole','id','role_id')->bind([
|
||||
|
||||
@@ -35,5 +35,19 @@ class UserRole extends Base
|
||||
{
|
||||
return $this->rules ? explode(',', $this->rules) : [];
|
||||
}
|
||||
public function setRightAttr($v='',$row=[])
|
||||
{
|
||||
if(is_array($v)){
|
||||
return json_encode($v);
|
||||
}
|
||||
return $v;
|
||||
}
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRightIds($v='',$row=[])
|
||||
{
|
||||
return $v ? (is_array($v) ? $v : json_decode($v,true)) : [];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user