20], [['POS_NAME'], 'string', 'max' => 100], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'ID' => 'ID', 'CANCEL_FLAG' => '记录有效性标记,CANCEL_FLAG=0记录有效;CANCEL_FLAG=1,记录已删除', 'CREATE_USER_ID' => '记录创建用户ID', 'CREATE_TIME' => '记录创建时间', 'UPDATE_USER_ID' => '记录最后更新用户ID', 'UPDATE_TIME' => '记录最后更新时间', 'RES_ID' => '资源ID', 'POS_X' => 'X座标', 'POS_Y' => 'Y座标', 'POS_TYPE' => '座位类别,DICT_TYPE.ID', 'POS_SEQ_ID' => '座位名称,自动选位时,以此作为是否连续座位的判断依据', 'POS_NAME' => '座位名称,在客人购买的票面上,显示此值作为客人购买的座位号', ]; } /** * Function Description:获取车次座位图 * Function Name: getMatrixArr * @param int $bus_type_res_id 车型资源id * * @return array|bool|ActiveRecord[] * * @author 张帅 */ public function getMatrixArr($bus_type_res_id) { $result = self::find() ->select([ 'pos_x', 'pos_y', 'pos_type', 'pos_seq_id', 'pos_name', ]) ->where([ 'and', ['=', 'res_id', $bus_type_res_id], ['=', 'cancel_flag', 0], ]) ->asArray()->all(); if(count($result) == 0){ return false; } return $result; } }