0){ $model = new \addons\xilufitness\model\CoachCash; $data['coach_id'] = $row['coach_id']; $data['brand_id'] = $row['brand_id']; $data['title'] = '余额提现'; $data['is_type'] = 4; $data['data_id'] = xilufitness_get_id_value($row['id']); $data['cash_type'] = 2; $data['cash_price'] = $row['withdraw_price']; $withdrawRow = $model ->where(['coach_id' => $data['coach_id'],'brand_id' => $data['brand_id'], 'is_type' => $data['is_type'], 'data_id' => $data['data_id'], 'cash_type' => $data['cash_type'] ]) ->field(['id']) ->find(); if(empty($withdrawRow)){ $model->allowField(true)->save($data); } } }); } }