array('identifier' => '异', 'text' => '不支持部分退款', 'color' => '#fc2047', 'search' => 'true'), self::__REPET_REFUND_CODE => array('identifier'=>'拒', 'text'=>'售后仅退款触发AG拒绝', 'color'=>'orange', 'search'=>'true'), self::__AG_NO_AUTO_REFUND => array('identifier'=>'AG', 'text'=>'退货完成AG自动退款失败', 'color'=>'red', 'search'=>'true'), ); /** * 获取Text * @param mixed $key key * @return mixed 返回结果 */ public function getText($key = null) { if ($key) { return (array) $this->status[$key]; } return $this->status; } /** * 获取Identifier * @param mixed $s s * @return mixed 返回结果 */ public function getIdentifier($s) { $str = ''; foreach ($this->status as $k => $v) { if ($s & $k) { $str .= sprintf("%s", $v['text'], $v['color'], $v['identifier']); } } return $str; } /** * 获取BoolType * @param mixed $filter filter * @return mixed 返回结果 */ public function getBoolType($filter) { $where = array(); if ($filter['in']) { $in = 0; foreach ((array) $filter['in'] as $val) { $in = $in | $val; } $where[] = 'abnormal_status & ' . $in . ' = ' . $in; } if ($filter['out']) { $out = 0; foreach ((array) $filter['out'] as $val) { $out = $out | $val; } $where[] = '!(abnormal_status & ' . $out . ')'; } if (empty($where)) { return array(); } $sql = 'select distinct abnormal_status from sdb_ome_refund_apply where ' . implode(' and ', $where); $rows = kernel::database()->select($sql); return $rows ? array_column($rows, 'abnormal_status') : ['-1']; } /** * 获取Options * @return mixed 返回结果 */ public function getOptions() { $options = array(); foreach ($this->status as $k => $v) { if ($v['search'] == 'true') { $options[$k] = $v['text']; } } return $options; } }