// +---------------------------------------------------------------------- namespace app\model\work; use crmeb\basic\BaseModel; use crmeb\traits\ModelTrait; /** * 渠道码周期规则 * Class WorkChannelCycle * @package app\model\work */ class WorkChannelCycle extends BaseModel { use ModelTrait; /** * @var string */ protected $name = 'work_channel_cycle'; /** * @param $value * @return mixed */ public function getWokrTimeAttr($value) { return $value ? json_decode($value, true) : []; } /** * @param $value * @return false|string */ public function serWokrTimeAttr($value) { return json_encode($value); } /** * @param $value * @return false|string */ public function setUseridsAttr($value) { return json_encode($value); } /** * @param $value * @return array|mixed */ public function getUseridsAttr($value) { return $value ? json_decode($value, true) : []; } }