PrestaShop:为RMA状态行添加背景颜色

I want to get the color of status to fill in the background color in prestashop default RMA. See image.enter image description here

I tried to find the correct tpl file without success. The code for status color i found on the orders page, which i think will work here also.

{if isset($tr.color) && $color_on_bg}style="background-color: {$tr.color}"{/if}

Prestashop 1.5.3.1

first you have to create a new method in the OrderReturnStat class. I'll guide you to reach the objective.

Create a new file name OrderReturnState.php in prestashop/override/classes/order/:

class OrderReturnState extends OrderReturn {
    public static function getOrderStateColor($id_order_return_state) {
        return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT color FROM `'._DB_PREFIX_.'order_return_state` WHERE id_order_return_state = '.(int)$id_order_return_state.'');
    }
}

After of that you have to create another file, I don't paste here because is too long, copy and paste this file

prestashop/youradminfolder/themes/default/template/helpers/list/list_content.tpl

in

prestashop/youradminfolder/themes/default/template/controllers/return/helpers/list/

now change your posted code in this

{if isset($tr.color) && $color_on_bg}style="background-color: {$tr.color}"{elseif $statecolor = OrderReturnState::getOrderStateColor($tr.state)}style="background-color: {$statecolor}"{/if}

After of this operations delete this file prestashop/cache/class_index.php

Now your rows are with background color of return state.