开发者

Fatal error: Unsupported operand types on line 20

开发者 https://www.devze.com 2023-02-16 10:37 出处:网络
line 20: $this->data[\'available_credits\'] = $total_credits - $used_credits; function index(){ $user_id = $this->session->userdata(\'user_id\');

line 20: $this->data['available_credits'] = $total_credits - $used_credits;

    function index()   {
    $user_id = $this->session->userdata('user_id');
    $this->data['credits'] = $this->credit_m->get_credit_details($user_id);
    $total_credits = $this-&g开发者_Python百科t;data['total_credits'] = $this->credit_m->get_total_credits($user_id);
    $used_credits = $this->data['used_credits'] = $this->credit_m->get_used_credits($user_id);
    $this->data['available_credits'] = $total_credits - $used_credits;
    $this->template->build('credits_view',$this->data);
}


I'm guessing your $total_credits variables $used_credits don't contain numbers -- they probable contain some objects, which cannot be substracted.

Check what your get_total_credits() and get_used_credits() methods return ; make sure they return values that can be used with the substraction operator.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号